Opened 8 years ago

Closed 8 years ago

#6016 closed defect (fixed)

What is the EPSG 4326 doing in the GeoJSON test?

Reported by: Kurt Schwehr Owned by: hobu
Priority: low Milestone:
Component: default Version: unspecified
Severity: minor Keywords:


In geojson test 11at source:trunk/autotest/ogr/, the GCS is coming back as 4269. Why is the test checking against 4326? Also, is it ever okay for pcs to not come back with 26915?

Out[]: '4269'
    ref = lyr.GetSpatialRef()
    gcs = int(ref.GetAuthorityCode('GEOGCS'))
    pcs = ref.GetAuthorityCode('PROJCS')
    if pcs:
        pcs = int(pcs)
    if  not gcs == 4326 and not pcs == 26915:
        gdaltest.post_reason("Spatial reference was not valid")
        return 'fail'

I think this code should be:

    ref = lyr.GetSpatialRef()
    gcs = int(ref.GetAuthorityCode('GEOGCS'))
    pcs = int(ref.GetAuthorityCode('PROJCS'))
    if  gcs != 4269 or pcs != 26915:
        gdaltest.post_reason('Spatial reference was not valid')
        return 'fail'

Any reason I shouldn't submit this?

Change History (4)

comment:1 by Kurt Schwehr, 8 years ago

Also, Why in this test does the layer report a different PCS than the geometry? 26915 versus 26916?

comment:2 by Kurt Schwehr, 8 years ago

Owner: changed from warmerdam to hobu

comment:3 by Even Rouault, 8 years ago


This test looks more convoluted than necessary (and the 'and 'should normally be a 'or' indeed). Only the PCS should be tested. The fact that PCS foo includes GCS bar isn't something specific to GeoJSON. Feel free to simplify it.

comment:4 by Kurt Schwehr, 8 years ago

Resolution: fixed
Status: newclosed

r29445 cleans up the test.

Looking at srs_name.geojson, I see that there is an overall srs and the point feature overrides that.

Note: See TracTickets for help on using tickets.