Re: [Geotools-gt2-users] Question about ESRI OIDs
There is an arcgis-rest module that seems to support AGS FetureServer: https://github.com/geotools/geotools/blob/main/modules/unsupported/arcgis-rest/src/main/java/org/geotools/data/arcgisrest/schema/services/feature/Featureserver.java and it seems to know a bit about esriFieldTypeOID https://github.com/geotools/geotools/blob/0d53ea0fff88f74588d0dab365894a56dea24361/modules/unsupported/arcgis-rest/src/main/java/org/geotools/data/arcgisrest/ArcGISRestFeatureSource.java#L76 You might be able to add the "native" type to the userData Map of the PropertyDescriptor (attribute) Map of the FeatureType while it parsers the service definition in ArcGISRestFeatureSource#buildFeatureType(). -M On 13-03-2024 01:59, SPDBA wrote: > I am accessing them via GeoTools so I want a GeoTools based solution. This is what I do initially to try and identify the "primary key" String key = "[fixme]"; List adl = schema.getAttributeDescriptors(); for (AttributeDescriptor attribute : adl) { if ( attribute.getType().isIdentified() || attribute.getLocalName().equalsIgnoreCase("OBJECTID")) { key = attribute.getLocalName(); break; } } ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] Question about ESRI OIDs
> I am accessing them via GeoTools so I want a GeoTools based solution. This is what I do initially to try and identify the "primary key" String key = "[fixme]"; List adl = schema.getAttributeDescriptors(); for (AttributeDescriptor attribute : adl) { if ( attribute.getType().isIdentified() || attribute.getLocalName().equalsIgnoreCase("OBJECTID")) { key = attribute.getLocalName(); break; } } On 13 Mar 2024, 09:03, at 09:03, SPDBA wrote: >Mark, > >They are not WFS, they are ESRI ArcGIS Feature Services. > >I am accessing them via GeoTools so I want a GeoTools based solution. > >Simon > >39 Cliff View Drive, Allens Rivulet, 7150, Tasmania, Australia >(P) 03 62 396 397 >(M) 0418 396 381 >(W) www.spdba.com.au > >On 13 Mar 2024, 04:05, at 04:05, Mark Prins wrote: >>On 09-03-2024 03:20, SPDBA wrote: >>> GeoTools people. >>> I've a simple question. >>> I'm connecting to an ArcGIS feature web service. >>> What I want to discover is which field in the published attributes >is >> >>> the primary key. The sites I am looking at can have OBJECTID fields >>of >>> type esriFieldTypeOID, but often the name is otherwise: rid, gid, >>fid, >>> oid etc etc. The common thing is that one field is of type >>> esriFieldTypeOID. >>> Looking at the source with GeoTools the data type is returned as >>> java.lang.Integer (AttributeDescriptor) which is fair enough in one >>> sense but not useful to distinguish a field from all other integer. >>So, >>> is there a way of discovering what field is of type >>> esriFieldTypeOID? >> >>it's unclear to me if you are talking about the esri native rest >>service >>interface aka "FeatureServer" or the OGC standard WFS interface of >AGS. >>The REST interface provides the esri types as metadata of a layer[0]; >>the WFS is limited to the types specified in the GML standard. >>Some WFS services use the primary key value to produce the gml:id >>attribute of a feature, this is exposed in GeoTools as the fid afaik >> >>[0] >>https://sampleserver6.arcgisonline.com/arcgis/rest/services/CommercialDamageAssessment/FeatureServer/0 >> >> >>or as json >>https://sampleserver6.arcgisonline.com/arcgis/rest/services/CommercialDamageAssessment/FeatureServer/0?f=pjson >> >> >> >>___ >>GeoTools-GT2-Users mailing list >>GeoTools-GT2-Users@lists.sourceforge.net >>https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users > > > > > > > > >___ >GeoTools-GT2-Users mailing list >GeoTools-GT2-Users@lists.sourceforge.net >https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] Question about ESRI OIDs
Mark, They are not WFS, they are ESRI ArcGIS Feature Services. I am accessing them via GeoTools so I want a GeoTools based solution. Simon 39 Cliff View Drive, Allens Rivulet, 7150, Tasmania, Australia (P) 03 62 396 397 (M) 0418 396 381 (W) www.spdba.com.au On 13 Mar 2024, 04:05, at 04:05, Mark Prins wrote: >On 09-03-2024 03:20, SPDBA wrote: >> GeoTools people. >> I've a simple question. >> I'm connecting to an ArcGIS feature web service. >> What I want to discover is which field in the published attributes is > >> the primary key. The sites I am looking at can have OBJECTID fields >of >> type esriFieldTypeOID, but often the name is otherwise: rid, gid, >fid, >> oid etc etc. The common thing is that one field is of type >> esriFieldTypeOID. >> Looking at the source with GeoTools the data type is returned as >> java.lang.Integer (AttributeDescriptor) which is fair enough in one >> sense but not useful to distinguish a field from all other integer. >So, >> is there a way of discovering what field is of type >> esriFieldTypeOID? > >it's unclear to me if you are talking about the esri native rest >service >interface aka "FeatureServer" or the OGC standard WFS interface of AGS. >The REST interface provides the esri types as metadata of a layer[0]; >the WFS is limited to the types specified in the GML standard. >Some WFS services use the primary key value to produce the gml:id >attribute of a feature, this is exposed in GeoTools as the fid afaik > >[0] >https://sampleserver6.arcgisonline.com/arcgis/rest/services/CommercialDamageAssessment/FeatureServer/0 > > >or as json >https://sampleserver6.arcgisonline.com/arcgis/rest/services/CommercialDamageAssessment/FeatureServer/0?f=pjson > > > >___ >GeoTools-GT2-Users mailing list >GeoTools-GT2-Users@lists.sourceforge.net >https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] Question about ESRI OIDs
On 09-03-2024 03:20, SPDBA wrote: GeoTools people. I've a simple question. I'm connecting to an ArcGIS feature web service. What I want to discover is which field in the published attributes is the primary key. The sites I am looking at can have OBJECTID fields of type esriFieldTypeOID, but often the name is otherwise: rid, gid, fid, oid etc etc. The common thing is that one field is of type esriFieldTypeOID. Looking at the source with GeoTools the data type is returned as java.lang.Integer (AttributeDescriptor) which is fair enough in one sense but not useful to distinguish a field from all other integer. So, is there a way of discovering what field is of type esriFieldTypeOID? it's unclear to me if you are talking about the esri native rest service interface aka "FeatureServer" or the OGC standard WFS interface of AGS. The REST interface provides the esri types as metadata of a layer[0]; the WFS is limited to the types specified in the GML standard. Some WFS services use the primary key value to produce the gml:id attribute of a feature, this is exposed in GeoTools as the fid afaik [0] https://sampleserver6.arcgisonline.com/arcgis/rest/services/CommercialDamageAssessment/FeatureServer/0 or as json https://sampleserver6.arcgisonline.com/arcgis/rest/services/CommercialDamageAssessment/FeatureServer/0?f=pjson ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users