[gdal-dev] Failure to fetch covid-19 data from JHU ArcGIS instance

Even Rouault even.rouault at spatialys.com
Tue Apr 7 03:29:57 PDT 2020


On mardi 7 avril 2020 11:19:56 CEST Francesco Bartoli wrote:
> Hello devs,
> 
> while the command line is working properly:
> 
> ogrinfo -ro -al
> "ESRIJSON:https://services1.arcgis.com/0MSEUqKaxRlEPj5g/arcgis/rest/service
> s/ncov_cases/FeatureServer/2/query?where=objectid+%3D+objectid&f=json&outFie
> lds=*"
> 
> this python script below unexpectedly fails:
> 
> from osgeo import ogr
> driver = ogr.GetDriverByName(‘ESRIJSON’)
> ds =
> driver.Open('https://services1.arcgis.com/0MSEUqKaxRlEPj5g/arcgis/rest/serv
> ices/ncov_cases/FeatureServer/2/query?where=objectid+%3D+objectid&f=json&out
> Fields=*')
> 
> ERROR 1: Invalid Feature object. Missing ‘geometry’ member.
> ERROR 1: Invalid Feature object. Missing ‘geometry’ member.
> 
> GDAL version is 3.0.4 and python 3.7.6
> 
> Do you have any hints?

This was due to 2 features not having a geometry member as indicated in the error message. 
This is illegal in GeoJSON, but apparently legal in ESRIJSon. I've just pushed a fix to avoid this 
error message and return a feature without geometry.
With the current versions, you should still be able to process the dataset. Just those features 
will be skipped.


-- 
Spatialys - Geospatial professional services
http://www.spatialys.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20200407/6e43585b/attachment.html>


More information about the gdal-dev mailing list