Feature Service vs. Map Service

34863
11
10-13-2017 06:32 AM
mpboyle
Occasional Contributor III

When publishing a map service, is there any advantage/reason to enable feature access unless you are going to edit features?

For example, if I want to add a REST endpoint to ArcGIS Online and save the layer as a read-only feature layer, is there any advantage to using a numbered feature service layer versus a numbered map service layer?  Obviously, if I wanted editing capabilities, I'd have to add the feature service layer, but if I simply want our users to have the ability to search for a layer and add it to a web map in ArcGIS Online, is using a numbered map service layer sufficient, or does a numbered feature service layer offer any benefits?

11 Replies
GISAdmin35
New Contributor II

Writing code that makes http requests - The /query capability could be used to do this on both feature and map services with json response, i.e f=pjson (or f=json😞

see

https://developers.arcgis.com/rest/services-reference/query-feature-service-.htm

https://developers.arcgis.com/rest/services-reference/query-map-service-layer-.htm

This assumes that the fields you want/need to extract are exposed via the service/layer and of course that query capability is enabled. Also, you will have to consider how you download a complete set of data as the response may be truncated/limited to the max feature result as configured on the service (Option 1: your first query use return object id's only as these are not not limited to the feature count, then using the objectid's construct a series of requests to get all the data... there are a approaches to this I'll leave it here. Option 2: in your request set order by OBJECTID in the response, and continue to query the service using where OBJECTID > yourPreviousRequestMaxObjectId until you get an empty response). You will then have to append all the results back together, I won't explain how to do that here either.

Alternatively, I can't remember exactly but I believe the sync capability on a service can also be exploited to download a gdb of the service. However you have to meet all of the requirements associated with setting this up and I can't remember them sorry.

http://enterprise.arcgis.com/en/server/latest/publish-services/windows/prepare-data-for-offline-use....

Hope that helps.

anshushrivastava
New Contributor II

hi,I am new in Arcgis .I want to know how i can show state names on shape file.Currently i am using following code to load shape file from local system.

void CTacticalViewClass::LoadingOfShapeFile(const QUrl& file)
{

    QString dataPath = file.toString();//this contains india.shp
    ShapefileFeatureTable* featureTable = new ShapefileFeatureTable(dataPath, this);
    featureTable->load();

    layer = new FeatureLayer(featureTable, this);
    m_Shapemap->operationalLayers()->append(layer);


    m_mapShapeView->setMap(m_Shapemap);
    m_mapShapeView->show();
    m_mapShapeView->raise();

}

0 Kudos