Some ESRI JSON still not parsible
Feature description
https://gdal.org/drivers/vector/esrijson.html can parse pool permits, but not cadastral data, yet (3.9.0).
We see the URLs are similar,
...sonline.com/arcgis/rest/services/PoolPermits/... ...gis.blm.gov/arcgis/rest/services/Cadastral/...
And no, it was not a GET vs. POST issue (#9995) because I first used my fetcher program to save the data into a file, $ echo WA330160N0260E0SN070 | sh fetch_blm_sections > file.json
The only thing left was I was using &f=json vs. &f=pjson. But pretty printing shouldn't be required to make json parsible.
ogrinfo -ro ESRIJSON:file.json
ERROR 1: Invalid FeatureCollection object. Missing 'fields' member.
Well, OK, maybe only pool permits have 'fields' members. I don't know. Hmmm. lots of members, just not 'fields':
perl -nwle 'print for /([a-z]\w+)/g;' file.json|sort -u|xargs|fold -s
attributes coordinates features generatedplss geometry landdescription lat
latestWkid lon plssid rings spatialReference status success trs wkid
Sure wish that ESRI corporation would put some version declaration into the JSOM they make.
Then I could say exactly what version of ESRI JSON the ESRIJSON driver doesn't support yet.
I assume it is from ESRI, as the URL has /arcgis/rest/services/ in it.
(Oddly ogrinfo -ro -al GeoJSONSeq:file.json can open it too,
INFO: Open of `GeoJSONSeq:file.json'
using driver `GeoJSONSeq' successful.
Layer name: file
Geometry: Unknown (any)
Feature Count: 1
but then never lists any actual features.)
Could you add some test data?
This test file has an empty Fields member https://github.com/OSGeo/gdal/blob/master/autotest/ogr/data/esrijson/esrizpolygon.json. Ogrinfo opens it. But if I remove the Fields altogether, then ogrinfo gives an error:
ERROR 1: Invalid FeatureCollection object. Missing 'fields' member.
ERROR 1: Layer schema generation failed.
I have not found the ESRI JSON schema yet so I cannot say if a missing Fields member is an error or not. But I think that if there are no "fields" then the features cannot have any attributes except geometry. That feels odd as cadastral data.
https://gis.blm.gov/arcgis/rest/services/Cadastral/BLM_Natl_PLSS_CadNSDI/MapServer/exts/CadastralSpecialServices/GetLatLon?trs=WA330160N0260E0SN070&returnalllevels=&f=pjson returns GetLatLon.json
similar: https://gis.blm.gov/arcgis/rest/services/Cadastral/BLM_Natl_PLSS_CadNSDI/MapServer/exts/CadastralSpecialServices/GetTRS?lat=46.889846925914661&lon=-119.61030783431359&units=DD&returnlevel=&returnalllevels=&f=pjson returns GetTRS.json