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: | |
Cc: |
Description
In geojson test 11at source:trunk/autotest/ogr/ogr_geojson.py#L562, 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?
srs.GetAuthorityCode('GEOGCS') 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 , 8 years ago
comment:2 by , 8 years ago
Owner: | changed from | to
---|
comment:3 by , 8 years ago
@goatbar
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 , 8 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
r29445 cleans up the test.
Looking at srs_name.geojson, I see that there is an overall srs and the point feature overrides that.
Also, Why in this test does the layer report a different PCS than the geometry? 26915 versus 26916?