Create and Publish Map Service without .MXD Via Python ?

223
0
12-06-2022 04:40 AM
RahulMark
New Contributor

In this tutorial we will see how to create a map service without using the .MXD file.

First, let's create a simple map service without any data. This will be used as a base for our tests.

The first step is to generate a feature layer that can be used by ArcGIS Server to create a map service using the MapServer protocol. To do this we need to use the "FeatureLayer" class from ESRI's ArcPy library. This class has many useful functions that can help us to create features and add them to our map service.

We want to add all of the cities in France as polygons so that when we run our service on the server, it will show us all of these cities on an interactive map. In order to do this, we need to first get all of the cities in France from Wikipedia and then use Python's built-in "json" module (which stands for JavaScript Object Notation) to convert these JSON objects into valid Python dictionaries.

We then convert these dictionaries into arrays using the "list()" function before converting them back into JSON using the "json()" function before finally converting them once again into Python dictionaries using another

0 Replies