AnsweredAssumed Answered

Data Download (GPService) using Python

Question asked by shikhar.deep9 on May 21, 2015

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?

Outcomes