Solved

ESRI feature service

  • 26 July 2018
  • 5 replies
  • 18 views

Badge +10

Hello There

we are looking to query the count of all the table from ESRI web feature service URL

any idea how we could do that, the syntax we should use, we want only the table name and total feature in each one

thanks

icon

Best answer by bruceharold 26 July 2018, 16:26

View original

5 replies

Badge +2

Hi,

You can load a feature service into FME using the Esri ArcGIS Portal reader or the Esri ArcGIS Onlone reader. You can make the table name visible through the "fme_feature_type" attribute which can be exposed either directly on the reader (under Format Attributes) or separately using the AttributeExposer transformer.

If you then read all records from all tables and summarize these through Counter transformers, that will give you the information you need. You can then write this to Excel or other formats if you need.

Badge +10

Hi,

You can load a feature service into FME using the Esri ArcGIS Portal reader or the Esri ArcGIS Onlone reader. You can make the table name visible through the "fme_feature_type" attribute which can be exposed either directly on the reader (under Format Attributes) or separately using the AttributeExposer transformer.

If you then read all records from all tables and summarize these through Counter transformers, that will give you the information you need. You can then write this to Excel or other formats if you need.

@ngoorman

 

 

the problem is there is a limte of the number feature we could load from the web service

 

Badge +2
@ngoorman

 

 

the problem is there is a limte of the number feature we could load from the web service

 

As far as I know FME should always read all features from a feature service - possibly older versions (eg 2016 and lower) might have an issue. Roughly how many features do you have in there?

 

 

Either way, I don't think there is any way to get a count of features without reading all of them. At least not with the regular transformers; possibly you can do something with Python.

 

 

Badge +16

You can return only the feature count from the Query endpoint with the returnCountOnly parameter:

returnCountOnly=true

You'll need an always true where parameter too, like where 1 = 1:

where=1+%3D+1

Complete example:

https://services.arcgis.com/FQD0rKU8X5sAQfh8/arcgis/rest/services/BBeach/FeatureServer/0/query?where=1+%3D+1&objectIds;=&time;=&geometry;=&geometryType;=esriGeometryEnvelope&inSR;=&spatialRel;=esriSpatialRelIntersects&resultType;=none&distance;=0.0&units;=esriSRUnit_Meter&returnGeodetic;=false&outFields;=&returnHiddenFields;=false&returnGeometry;=true&multipatchOption;=xyFootprint&maxAllowableOffset;=&geometryPrecision;=&outSR;=&datumTransformation;=&applyVCSProjection;=false&returnIdsOnly;=false&returnUniqueIdsOnly;=false&returnCountOnly;=true&returnExtentOnly;=false&returnDistinctValues;=false&orderByFields;=&groupByFieldsForStatistics;=&outStatistics;=&having;=&resultOffset;=&resultRecordCount;=&returnZ;=false&returnM;=false&returnExceededLimitFeatures;=true&quantizationParameters;=&sqlFormat;=none&f;=html&token;=<token>

Badge +2

FME will read all the records in your layer or table. I don't think this is optimum if all you want is a list of layers & tables and record counts. The schema reader - Schema (any format) - will help you get a list of all your feature service layers & tables. You get one feature per layer/table. You can also accomplish this using the FeatureReader transformer - it has a Schema output port.

But Schema reader doesn't return a table count. For this I think you'd need to use the HTTPCaller and send a request to the ArcGIS Feature Service REST API - as Bruce suggests. Looks like the 'layer' resource is the end point you need. Refer to the ArcGIS REST API documentation.

Reply