Hot answers tagged

8

According to Romain D on it1me.com, it can be done with the Leaflet.PolylineOffset as referenced in the comments by MattPil29 above. I have adapted it for the data in your example. I turned off your original line by changing opacity to 0 in myStyle. There is probably a more elegant way to not add it. The other key is flipping the x,y coordinate to make L....


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', ...


2

Where can I find data to produce these sort of visualizations? You're asking for administrative boundaries. How to get the official version depends on the country's administration. As far as I'm aware, a normalized dataset for all official administrative boundaries doesn't exist. IMHO the closest you might get to that is Natural Earth or OpenStreetMap. ...


2

You could use the CartoDB SQL API with CartoDB.js to call the data that you want to display depending on where the user click. In this section of the CartoDB documentation you can find more information about using theCartoDB SQL API within CartoDB.js. In this example you can find how a buffer is created everytime that a user clicks on the map and the points ...


2

I couldn't get your overpass query to work so I tried building it using the wizard. I confess I tend to use the QuickOSM plugin as I find the overpass query language a bit tricky :) This is the query I went with:- /* This has been generated by the overpass-turbo wizard. The original search was: “natural=water or water=lake or waterway=*” */ [out:json][...


2

Might just need e.target or e.layer before feature.properties.name - console.log is your friend here and will likely answer your question.


2

It is pretty simple actually, you just need to iterate through the features of the geojson structure once you have got it in a dictionary format (like from the json.load() function). I don't work with GeoServer WFS services, but I did find a json example online. The first shows just how to iterate through the json and get an arcpy.Geometry object back. ...


2

I would try to filter by Geometry Type during each conversion. For example, only Lines should be forced into the Line shapefile. I think your examples are Casting Lines to Polygons and Polygons to Lines. The geometry filter should prevent this from happening. Please see the OGR_GEOMETRY example in the OGR_SQL help. http://www.gdal.org/ogr_sql.html


2

It's worth noting that the encoding format you are using is Google's Encoded Polyline Algorithm Format. I was also not able to find a tool that converted directly from EPAF to GeoJSON, but I did find a mapbox project on Github that provides the functionality in JavaScript. As you said you are not a coder, I wrapped the functionality into a JSFiddle for you ...


2

Try to disable the "Support on the fly geometry simplification" parameter in the postgis store configuration in GeoServer. And make sure your polygon stays within the "world" boundaries, best if it's not touching the datelines. Also disable "advanced projection handling" in the WMS settings


1

Esri has some JavaScript libraries that will get you from GeoJSON to ArcGIS Server JSON. Terraformer ArcGIS Parser arcgis-to-geojson-utils (Despite the name, it converts in both directions)


1

Instead of the CARTO SQL API, you can insert your geojson sample to a CARTO column value (geojson_data, for example). And then use the PostGIS ST_GeomFromGeoJSON and set the_geom to the result: UPDATE name_table SET the_geom = ST_GeomFromGeoJSON(geojson_data) You will end up with this dataset/map.


1

If the problem is that "feature.properties.name is undefined" just pass the feature into openSidedbar. And if you want to display "this is A" or "this is B" pass that feature parameter into html (assuming that sidebar is a jQuery object): UPDATE function onEachFeature(feature, layer) { layer.on({ mouseover: highlightFeature, mouseout: ...


1

I got OGR to open the dataset using the syntax from an example in the GeoJSON driver help: from osgeo import ogr url = "http://maps.six.nsw.gov.au/arcgis/rest/services/sixmaps/LPIMap/MapServer/69/query?where=objectid+%3D+objectid&outfields=*&f=json" ds = ogr.Open(url) Or: ogrinfo -ro "http://maps.six.nsw.gov.au/arcgis/rest/services/sixmaps/LPIMap/...


1

you want to create a layer with a single feature so you must use: features: [features[0]]


1

1) I just don't know how to convert .geojson file to .shp. This is a one of the bases of ogr Python. If you have a geometry, it is very easy to convert it to a shapefile # geojson is GeoJson Polygon from osgeo import ogr output = "geojson.shp" driver = ogr.GetDriverByName('ESRI Shapefile') if os.path.exists(output): driver.DeleteDataSource(output) ...


1

There are now Python modules easier to use for that, as rasterio Rasterio employs GDAL to read and writes files using GeoTIFF and many other formats. Its API uses familiar Python and SciPy interfaces and idioms like context managers, iterators, and ndarrays. Therefore from Masking raster with a polygon feature in Rasterio Cookbook import rasterio ...


1

I didn't work through the issue with your data but my perspective is that the error comes down to a limitation of shapefile format. Topological consistency is not enforced/inherent in the shapefile format (esri's explanation here). The Mongo spatial indexing system does require topological consistency. Lacking the enforcement of consistency in the source ...


1

The OpenStreetMap’s French community are maintaining a rather exhaustive and accurate set of maps. Whether you’re a cartographer, a graphic designer or a developer, they’ve made it easy to reuse their work. As a matter of fact, from the OpenStreetMap’s OSM format, they’ve exported the maps to various formats such as Shapefiles, SVG, GeoJSON (to mention a few ...



Only top voted, non community-wiki answers of a minimum length are eligible