Demo of ArcGIS.PCL running on ScriptCS
- Make sure scriptcs is installed
- Install packages
scriptcs -install
- Run the sample you want. The following are included
scriptcs start.csx
- return a url for each service found for the ArcGIS Server specifiedscriptcs geocode.csx
- return the location of the text specifiedscriptcs reversegeocode.csx
- return the address of the location specifiedscriptcs servicestatus.csx
- check that each service for an ArcGIS Server site is in its configured state. This sample requires access to the ArcGIS Server admin REST API and you will need to put in your own server url, username and password.scriptcs query.csx
- query an ArcGIS Server service for features. In this case get the earthquakes for the past week with a magnitude greater than 4.5scriptcs queryandreversegeocode.csx
- example of combining a query operation with a reverse geocode to try and populate the location of the query results with an address
The script pack allows you to create an ArcGIS Server gateway using
var arcgis = Require<ArcGISPack>();
var gateway = arcgis.CreateGateway("http://localhost/arcgis");
The returned gateway
supports the following as typed operations:
Query<T>
- query a layer by attribute and / or spatial filtersQueryForCount
- only return the number of results for the query operationQueryForIds
- only return the ObjectIds for the results of the query operationFind
- search across n layers and fields in a serviceApplyEdits<T>
- post adds, updates and deletes to a feature service layerGeocode
- single line of input to perform a geocode using a custom locator or the Esri world locatorSuggest
- lightweight geocode operation that only returns text results, commonly used for predictive searchingReverseGeocode
- find location candidates for a input point locationSimplify<T>
- alter geometries to be topologically consistentProject<T>
- convert geometries to a different spatial referenceBuffer<T>
- buffers geometries by the distance requestedDescribeSite
- returns a url for every service discoveredPing
- verify that the server can be accessedPublicKey
- admin operation to get public key used for encryption of token requestsServiceStatus
- admin operation to get the configured and actual status of a service
In all cases above T
is a geometry type of Point
, MultiPoint
, Polyline
, Polygon
or Extent
If you need to call secure resources and your ArcGIS Server supports token based authentication then specify a TokenProvider
in your call to CreateGateway
var arcgis = Require<ArcGISPack>();
var gateway = arcgis.CreateGateway("http://localhost/arcgis", new TokenProvider("http://localhost/arcgis", "username", "password"));