Opened 2 years ago

Closed 2 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@… 2 years ago.
script to demonstrate bug
19171-1.diff (3.1 KB) - added by claudep 2 years ago.
Transform should work with custom srid

Download all attachments as: .zip

Change History (5)

Changed 2 years ago by reidpr@…

script to demonstrate bug

comment:1 Changed 2 years ago by claudep

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

Changed 2 years ago by claudep

Transform should work with custom srid

comment:2 Changed 2 years ago by claudep

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

  • Resolution set to fixed
  • Status changed from new to closed

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