The regparse package. Contains parsers for ESRI feature services and WMSes.
An ESRI feature “parser” (really the requests library does most of the actual parsing).
Most of the utility functions are exposed but most applications won’t use them :func:make_node is generally the only point of interest here.
Generates a mapping of layer labels to image data URLs.
Parameters: |
|
---|---|
Returns: | dict – a mapping of ‘label’ => ‘data URI encoded image’ |
Converts a feature service URL into a legend request. Handles the optional ‘/’ at the end of requests.
Parameters: | feature_service_url (str) – A URL pointing to an ESRI feature service |
---|---|
Returns: | str – A URL pointing to a legend request |
Generates a mapping of field names to field aliases.
Parameters: | json_data (list) – An array of field objects, taken from the fields property of an ESRI feature service endpoint |
---|---|
Returns: | dict – a mapping of ‘name’ => ‘alias’ |
Generate a RAMP datagrid by walking through the attributes. Iterates over all entries in fields that do not have a type of esriFieldTypeGeometry
Parameters: | json_data (dict) – A dictionary containing scraped data from an ESRI feature service endpoint |
---|---|
Returns: | dict – A dictionary with a single entry gridColumns containing an array of datagrid objects |
Extracts the extent for the layer from ESRI’s JSON config.
Parameters: | json_data (dict) – A dictionary containing scraped data from an ESRI feature service endpoint |
---|---|
Returns: | dict – A dictionary with the same data as the ESRI layerExtent node |
Parameters: | kw – Takes keyword arguments and just fills in the defaults |
---|---|
Returns: | dict – a dictionary with the defaults applied |
Generate a RAMP layer entry for an ESRI feature service.
Parameters: |
|
---|---|
Returns: | dict – a RAMP configuration fragment representing the ESRI layer |
Generates a symbology node for the RAMP configuration. Handles simple, unique value and class break renders; prefetches all symbology images.
Parameters: |
|
---|---|
Returns: | dict – a symbology node |
A WMS “parser” (barely does any parsing at the moment).
Make a RAMP feature info node, identifying the correct default parser to be used based on the MIME type of the feature info request.
Parameters: | data (dict) – The initial payload to RCS |
---|---|
Returns: | dict – A feature info configuration fragment; None if no valid mimeType was set |
Generate a RAMP layer entry for a WMS.
Parameters: |
|
---|---|
Returns: | dict – a RAMP configuration fragment representing the WMS layer |