Select to view content in your preferred language

Querying for a feature using GlobalID without specifying a layer

3354
2
Jump to solution
08-31-2017 10:55 AM
GregSmith2
Occasional Contributor

Is there any way to return a feature from a published service layer using solely the GlobalID? I understand that the GlobalID is universally unique across a workspace, and what I'd like to do is return a feature from an ArcGIS Portal without providing a service or layer in my query to the ArcGIS REST API.

From what I can tell, there is no way to query for a feature at the server level in the ArcGIS REST API (it looks like a layer in a service must be provided), but maybe I am missing something. Any insight would be appreciated!

0 Kudos
1 Solution

Accepted Solutions
MicahBabinski
Frequent Contributor

Hi Greg,

Have a look at the ArcGIS REST API documentation for the Query (Operation). As you can see, layer is the first parameter, and is required. You could use python to query for a specific GLOBALID across a GIS Server by looping through all the feature layers in a GIS server that support the query operation. The issue, as I see it, is that since features published via a GIS server can come from multiple geodatabases. This could include any number of file-based or remote geodatabases. Since GLOBALID is unique only across the geodatabase, there's no way to ensure that your GLOBALID would not be duplicated within a GIS server.

Micah

View solution in original post

2 Replies
MicahBabinski
Frequent Contributor

Hi Greg,

Have a look at the ArcGIS REST API documentation for the Query (Operation). As you can see, layer is the first parameter, and is required. You could use python to query for a specific GLOBALID across a GIS Server by looping through all the feature layers in a GIS server that support the query operation. The issue, as I see it, is that since features published via a GIS server can come from multiple geodatabases. This could include any number of file-based or remote geodatabases. Since GLOBALID is unique only across the geodatabase, there's no way to ensure that your GLOBALID would not be duplicated within a GIS server.

Micah

GregSmith2
Occasional Contributor

Micah,

Thanks for your reply! I did consider just looping through all the feature layers like you mention, but I'd like to avoid that to save extra processing time, especially since I will already know the layer and OBJECTID beforehand (I was trying to use just the GLOBALID instead because it stores better in my database that is talking to my GIS server). Also, that is an excellent point about published services potentially coming from many different data sources (and the GLOBALID only being unique per data source); I had not considered that when I wrote this post. It seems that the best way to proceed with this for now is to just continue storing the layer and OBJECTID to return features, instead of the GLOBALID.

Thanks again,

Greg

0 Kudos