SVG attribute is not transformed

10 views
Skip to first unread message

Stodge

unread,
Jul 10, 2014, 2:34:24 PM7/10/14
to django...@googlegroups.com
I'm adding map data from a new source that needs to be projected so I transform the query set like this:

 q = Polyline.objects.filter(overlay='63979e90-a578-4d18-af0a-8bd75279d923').transform(93997).svg()

The resulting SVG attribute isn't transformed. The documentation says:

Attaches a SVG attribute to every model in the queryset that contains the Scalable Vector Graphics (SVG) path data of the geometry fields.

Which seems to confirm my suspicion - at least how I read it. Printing the query confirms that the SVG attribute isn't transformed:

print q.query
SELECT (ST_AsSVG("airmap_polyline"."the_geom",0,8)) AS "svg", "airmap_polyline"."id", "airmap_polyline"."overlay_id", ST_Transform("airmap_polyline"."the_geom", 93997) FROM "airmap_polyline" WHERE "airmap_polyline"."overlay_id" = 63979e90-a578-4d18-af0a-8bd75279d923

Is there a way to apply the transform to the SVG attribute? I can get it working using raw SQL but I thought I should be able to use the ORM. Thanks


Reply all
Reply to author
Forward
0 new messages