New answers tagged

0

The following code will parse an ArcGIS (ESRI) REST MapServer MultiLineString JSON url so that it can be read by the GDAL GeoJSON driver. The code achieves this by constructing a new JSON object and copying the relevant data from the ArcGIS REST MapServer JSON url. This could be easily turned into a function. import ogr import urllib, json url = 'http://...


2

The easiest way to make a JSON element accessible is to put it in a JavaScript file. As an example, create a file mapSettings.js in the same directory as your other JavaScript file. Then define your JSON object like this var mapConfig = { "lat": 15, "lon": 35, "zoom": 4, "layer": "https://myLayerUrl.com/layer/" }; Now ...


4

I like to use the json_build_object function. SELECT row_to_json(fc) FROM ( SELECT 'FeatureCollection' As type, array_to_json(array_agg(f)) As features FROM ( SELECT 'Feature' As type , ST_AsGeoJSON(lg.geometry)::json As geometry , json_build_object( 'attribute1', attribute1, 'attribute2', ...


0

AFAIK WPS only supports XML as the request format, the formats you are seeing in the DescribeProcess document are for the encoding of the geometry element. So your request should look something like: <?xml version="1.0" encoding="UTF-8"?><wps:Execute version="1.0.0" service="WPS" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://...


1

I think you're close, just a few notes about what you need to do to get this working: The major note is that you need to wrap your code that looks at the attributes in on on event handler, so you're waiting until the layer's data is actually loaded before you try to change it. I could not find STATEFP in your service ... looks like STATE is what you want. ...


1

the problem could be from the CORS not enabled, if your web page is in a web server not in geoserver, you can either: 1- put your web page in the www folder inside geoserver/data_dir and lauch it from there 2 - or if you need to launch it from a web server ( apache for example ) you will have to enable JSONP in your geoserver configuration like this : go ...


0

I just got a basic Leaflet webpage setup and working after hacking away at it for a long time before finally giving up and asking for help on StackOverflow (the Leaflet.com quickstart tutorials do not have working code, or I may have missed something there where it talks about the #map properties inside style tags). Check out this stackoverflow question for ...



Top 50 recent answers are included