Opened 4 years ago

Closed 4 years ago

#19171 closed Bug (fixed)

unnecessary SRID lookup makes coordinate transform from custom SRS to standard SRS fail

Reported by: reidpr@… Owned by: nobody
Component: GIS Version: 1.4
Severity: Normal Keywords: coordinate transformation
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


Running the attached script crashes with django.contrib.gis.gdal.error.SRSException: Unsupported SRS.. It shouldn't, as the CoordTransform object contains complete information for the transformation.

The problem seems to be that the SRID of point b is looked up before the transformation, and this lookup fails (as is expected, because it's a custom SRS). But the lookup is not necessary, because the SRID of point b is ignored during the transformation (which can be demonstrated by substituting a bogus SRID on b before the transformation -- the results are still correct).

This is Django version 1.4.1 on:

  • Fedora 14 with custom-compiled GDAL 1.9.2, GEOS 3.3.5, and PROJ4 4.8.0
  • Debian Wheezy with GDAL 1.9.0, GEOS 3.3.3, and PROJ4 4.7.0 that came with the OS.

Attachments (2) (733 bytes) - added by reidpr@… 4 years ago.
script to demonstrate bug
19171-1.diff (3.1 KB) - added by Claude Paroz 4 years ago.
Transform should work with custom srid

Download all attachments as: .zip

Change History (5)

Changed 4 years ago by reidpr@…

Attachment: added

script to demonstrate bug

comment:1 Changed 4 years ago by Claude Paroz

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset
Triage Stage: UnreviewedAccepted

Changed 4 years ago by Claude Paroz

Attachment: 19171-1.diff added

Transform should work with custom srid

comment:2 Changed 4 years ago by Claude Paroz

Has patch: set

As the crash was happening during the build of the ogr geometry equivalent, I'd rather fix the issue at that level, and default to a "naive" ogr geometry when a SRSException occurred.

comment:3 Changed 4 years ago by Claude Paroz <claude@…>

Resolution: fixed
Status: newclosed

In 360217fc87db82575c8b07704143ced07c2a234c:

Fixed #19171 -- Allowed coordinate transforms with custom SRIDs

Thanks reidpr at for the report.

Note: See TracTickets for help on using tickets.
Back to Top