Hot answers tagged

7

Speaking purely from a data storage and analysis perspective, the geography type for PostGIS was designed with the antimeridian in mind (among several design goals). There are several functions specifically designed for the geography type. For instance, consider a LineString across Taveuni, Fiji (mapped with Great Circle Mapper), which straddles the ...


2

Things may be different from when you posted this originally. With current Mapnik versions (3.0.10 for example), this should work: <Style name="cities" filter-mode="first"> <Rule> <MarkersSymbolizer width="50" fill="#ff4455" stroke="#881133" allow-overlap="true" ignore-placement="true" /> </Rule> </Style> <Layer ...


2

Update: nested collections are specifically NOT RECOMMENDED in the latest GeoJSON specification. To maximize interoperability implementations SHOULD avoid nested geometry collections. Furthermore, geometry collections composed of a single part or a number of parts of a single type SHOULD be avoided when that single part or a single object of multi-part ...


2

You don't need Fiona to write a GeoJSON file features = [feat for feat in fiona.open("a_shapefile.shp") layer = { "type": "FeatureCollection", "features": features} # save json file import json #or GeoJSON with open('result.geojson', 'w') as outfile: json.dump(my_layer,outfile) No CRS is explicitly defined inside the original GeoJSON ...


2

The L.geoJson() constructor is actually just a convenient tool to convert GeoJSON data into Leaflet vector / path object(s) (like L.polyline, L.polygon, etc.). It also attaches the extra information that may be contained in the GeoJSON data into the created Leaflet objects (in layer.feature.properties for example). Therefore, if the GPS track that you ...


2

A GeometryCollection that contains only an array of points is less optimal than a MultiPoint. See https://tools.ietf.org/html/draft-ietf-geojson-03#section-3.1.8. To maximize interoperability implementations SHOULD avoid nested geometry collections. Furthermore, geometry collections composed of a single part or a number of parts of a single type ...


2

The GeoJSON is valid and renders fine, see http://playground-leaflet.rhcloud.com/kogi/edit?html,output. However, the use of jquery to fetch it is not. Make sure the request is returning JSON (hint: use dataType: 'json' in your jquery ajax call), and do not stringify the result Ion the contrary, run JSON.parse() if all you've got is a string). If you ...


1

Because of CORS-issues you cannot(?) load files directly from the harddrive. But there is a simple solution: if you have python installed, you can use the builtin web server. Simply run python -mhttp.server <portnumber> or python -mSimpleHTTPServer <portnumber> , depending on your python version (version 2 uses SimpleHTTPServer and ...


1

1) a MultiPoint GeoJSON (list of coordinates) {'type': 'MultiPoint', 'coordinates': ((197434.0074146679, 90234.91638080444), (198639.4631111624, 89807.44982176385), (197758.8819995387, 88943.96737250185), (198374.4338445572, 88473.7541575572), (197895.6712984317, 88020.63960497417), (196921.0475438192, 88345.51418984502), (196536.3276406827, ...


1

Step 1: Make a Selection of the specific sub-polygon Step 2: Save your selection as a separate feature, but make sure to choose GeoJSON as your file save type


1

The error message and specifications are pretty clear: GeoJSON supports the following geometry types: Point, LineString, Polygon, MultiPoint, MultiLineString, and MultiPolygon. PolyhedralSurface is not in that list, so you'll need to convert it to another geometry type.


1

According to the answer here, Leaflet doesn't "remember" what and whether a layer was filtered, so you need to reinitialise the layer when your filter changes. Something like this... You'll need to store your data somewhere, and you'll need to call the function from your init function with the default value. (BTW if you're going to have more than two ...


1

You do realize that your tutorial for "featureOver" makes you superimpose a new layer / feature above your track. Therefore, the latter can no longer be clicked on. You could either implement your "featureClick" listener on the added layer / feature as well, so that it opens your sidebar. Or you could rather change the display properties of the ...


1

Altough I wasn't able to find a bug in the above code... I managed to work it around using another way to load GeoJSON based layers. Another thing, the lat and longs weren't properly ordered in the example given (so that the correspond to positions on Rosario, Argentina)... Below are written correctly. <!DOCTYPE html> <html> <head> ...


1

Municipal ward level maps can be found here: https://github.com/mickeykedia/India-Maps


1

Yes, you can use layer.bringToFront() and layer.bringToBack() methods of leaflet. See the docs here.



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