Opened 12 years ago

Closed 12 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

Description

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)

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

Download all attachments as: .zip

Change History (5)

by reidpr@…, 12 years ago

Attachment: djangofail.py added

script to demonstrate bug

comment:1 by Claude Paroz, 12 years ago

Triage Stage: UnreviewedAccepted

by Claude Paroz, 12 years ago

Attachment: 19171-1.diff added

Transform should work with custom srid

comment:2 by Claude Paroz, 12 years ago

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 by Claude Paroz <claude@…>, 12 years ago

Resolution: fixed
Status: newclosed

In 360217fc87db82575c8b07704143ced07c2a234c:

Fixed #19171 -- Allowed coordinate transforms with custom SRIDs

Thanks reidpr at lanl.gov for the report.

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