Select to view content in your preferred language

Data Download (GPService) using Python

2547
0
05-21-2015 07:08 AM
ShikharDeep1
Deactivated User

I am developing a python script  to download the data of feature layers from MapServer. While hitting a empty feature layer (published layer with fields but no features), the query returns just the object id.

Hitting the following Query

mapservicequery_jsondata = json.loads(urllib2.urlopen(url).read())

     where

     url = urltoMapserverwithLayerID+ '/'+ ("query?where=1%3D1&returnGeometry=true&returnCountOnly=false&returnIdsOnly=" +                "false&outFields=*&f=pjson&token="+token)

    

     The output in json it gives is:

     {

           "objectIdFieldName": "OBJECTID",

           "globalIdFieldName": "",

           "features": []

        }

How can I get the fields (i.e. schema) of the empty feature layer downloaded?

0 Kudos
0 Replies