Opened 16 months ago

Closed 16 months ago

Last modified 9 months ago

#22456 closed New feature (fixed)

Add PostGIS 2.1 / GDAL 1.10 support

Reported by: timo Owned by: claudep
Component: GIS Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

In Ubuntu 14.04, the packaged version of PostGIS is 2.1. In trying to build a Jenkins box, I've encountered one failing test:

Traceback (most recent call last):
  File "/var/lib/jenkins/jobs/Django/workspace/database/postgis/python/python2.7/django/contrib/gis/tests/test_spatialrefsys.py", line 113, in test_add_entry
    add_srs_entry(900913)
  File "/var/lib/jenkins/jobs/Django/workspace/database/postgis/python/python2.7/django/contrib/gis/utils/srs.py", line 52, in add_srs_entry
    srs = SpatialReference(srs)
  File "/var/lib/jenkins/jobs/Django/workspace/database/postgis/python/python2.7/django/contrib/gis/gdal/srs.py", line 96, in __init__
    self.import_epsg(srs_input)
  File "/var/lib/jenkins/jobs/Django/workspace/database/postgis/python/python2.7/django/contrib/gis/gdal/srs.py", line 287, in import_epsg
    capi.from_epsg(self.ptr, epsg)
  File "/var/lib/jenkins/jobs/Django/workspace/database/postgis/python/python2.7/django/contrib/gis/gdal/prototypes/errcheck.py", line 117, in check_errcode
    check_err(result)
  File "/var/lib/jenkins/jobs/Django/workspace/database/postgis/python/python2.7/django/contrib/gis/gdal/error.py", line 53, in check_err
    raise e(msg)
SRSException: Unsupported SRS.

Change History (11)

comment:1 Changed 16 months ago by claudep

900913 srs is deprecated for some time now (replaced by 3856), I think we could safely remove it from our code.
However, we should still check if it doesn't break anything regrading OpenLayers (see also http://docs.openlayers.org/library/spherical_mercator.html).

comment:2 Changed 16 months ago by claudep

And FWIW, it might be more related to the GDAL version than to PostGIS. What is the GDAL version?

comment:3 Changed 16 months ago by timo

  • Summary changed from Add PostGIS 2.1 support to Add PostGIS 2.1 / GDAL 1.10 support

GDAL 1.10.1 (which I see isn't listed as supported).

comment:4 Changed 16 months ago by timo

I tried updating the test to use the alternate SRS as suggested, but still get the same exception so possibly I have a bad configuration or missing installation of something, but the test passes on Ubuntu 12.04 with pretty much the same configuration. The main difference I can think of is that 14.04 is using CREATE EXTENSION postgis; with PostGIS 2.1 while 12.04 is using the createdb -T template_postgis <db_name> technique on PostGIS 1.5.

I guess I will go back to building the new Jenkins on 12.04 as there are some failing tests on 1.4 that would require backporting a couple things like [747f7d25] which we shouldn't do if we are only doing security updates for 1.4.

comment:5 Changed 16 months ago by claudep

  • Owner changed from nobody to claudep
  • Status changed from new to assigned

Tim, I'm so sorry, it is 3857, not 3856 /o\. I'll care for this issue.

comment:6 Changed 16 months ago by Claude Paroz <claude@…>

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

In c082f3c74c63f0939e349896cc802205a8863dfa:

Fixed #22456 -- Replaced 900913 EPSG code by 3857 in some tests

3857 is now the official EPSG code for the Google spherical mercator
projection and some recent versions of GDAL do not recognize 900913
any longer.
Thanks Tim Graham for the report and initial patch.

comment:7 Changed 16 months ago by Claude Paroz <claude@…>

In f039c555cad59ef21b2ce3fcfda0579d82fd45a6:

[1.7.x] Fixed #22456 -- Replaced 900913 EPSG code by 3857 in some tests

3857 is now the official EPSG code for the Google spherical mercator
projection and some recent versions of GDAL do not recognize 900913
any longer.
Thanks Tim Graham for the report and initial patch.
Backport of c082f3c74c from master.

comment:8 Changed 16 months ago by Claude Paroz <claude@…>

In 3cea917e3e8a26b5b701c160f4f6e03b1b85cf84:

Confirmed support for PostGIS 2.1 and GDAL 1.10

Refs #22456.

comment:9 Changed 16 months ago by Claude Paroz <claude@…>

In edaff9b0dffc9ad984671673214d671d84abe144:

[1.7.x] Confirmed support for PostGIS 2.1 and GDAL 1.10

Refs #22456.
Backport of 3cea917e3e from master.

comment:10 Changed 9 months ago by Darkless012

Gosh, Fix also the DOC please!
I've spent significant time figuring out "What the hell is wrong"

https://docs.djangoproject.com/en/dev/ref/contrib/gis/install/

FROM:
add_srs_entry(900913)
TO:
add_srs_entry(3857)

comment:11 Changed 9 months ago by timgraham

If you believe there is a doc error, please open a new ticket. It's unclear why that would be related to this ticket as that section is described as "If you’re running GDAL 1.7 or above (most users), you can skip this step."

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