Topics

Using Fiona to consume ESRI FeatureServer service


Chander Ganesan
 

Hello,

I'm attempting to use fiona to consume an ESRI FeatureServer service - I've pased an example call below..  The issue is that OGR's documentation indicates that so long as I omit the resultOffset parameter for the service, it will handle paging for me.  Case in point - OGRInfo returns the proper, expected count of 2000+ records.

However, when I use Fiona (or, in my case geopandas, which uses Fiona) I find that the paging doesn't happen - I get 1000 records and that's it.

Is there an option/argument to get fiona to handle paging of results with the service, as OGR does?

Thanks! 


Chander Ganesan
 

FYI, I've also tried to use fiona.Env(FEATURE_SERVER_PAGING='true') as a context processor - that doesn't work either.


Sean Gillies
 

Hi,

I'm not very familiar with this category of data, but I see in https://gdal.org/drivers/vector/esrijson.html that `FEATURE_SERVER_PAGING` is an *open* option, not a configuration option. That means you must pass it to fiona.open() like

with fiona.open('https://services.arcgis.com/...&f=json', FEATURE_SERVER_PAGING="YES") as collection:
    features = list(collection)

I hope this helps,

On Thu, Jul 30, 2020 at 11:41 AM Chander Ganesan <chander.ganesan@...> wrote:
FYI, I've also tried to use fiona.Env(FEATURE_SERVER_PAGING='true') as a context processor - that doesn't work either.



--
Sean Gillies


Chander Ganesan
 

Thanks! That worked for me - sorry, I didn't realize the difference between open options and config options.

I'm basically in the process of using multicorn to provide a FDW to access ArcGIS FeatureServer layers via postgresql.  I'm also finding an issue with SSL, which I cannot figure out - I suspect that it's tied somehow to the environment that the script runs in under multicorn (because from the command line the attempt to open the layer works just fine.) However, if you have some other insight I'd love to hear it.

If I can't get past this I'll go another route...  Probably pgsql-ogr-fdw (I need to munge some of the data coming back from the service to allow for time-related queries/read - and FeatureServer represents times in epoch milliseconds, hence me not using the pgsql one out of the box.)

This is after an: import fiona; fiona.open('https://services.arcgis.com/...&f=json') 

TIA! :-) 

Traceback (most recent call last):
        File "fiona/_shim.pyx", line 74, in fiona._shim.gdal_open_vector
        File "fiona/_err.pyx", line 270, in fiona._err.exc_wrap_pointer
fiona._err.CPLE_HttpResponseError: CURL error: failed setting cipher list: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH

On Thu, Jul 30, 2020 at 10:17 PM Sean Gillies <sean.gillies@...> wrote:
Hi,

I'm not very familiar with this category of data, but I see in https://gdal.org/drivers/vector/esrijson.html that `FEATURE_SERVER_PAGING` is an *open* option, not a configuration option. That means you must pass it to fiona.open() like

with fiona.open('https://services.arcgis.com/...&f=json', FEATURE_SERVER_PAGING="YES") as collection:
    features = list(collection)

I hope this helps,

On Thu, Jul 30, 2020 at 11:41 AM Chander Ganesan <chander.ganesan@...> wrote:
FYI, I've also tried to use fiona.Env(FEATURE_SERVER_PAGING='true') as a context processor - that doesn't work either.



--
Sean Gillies