Tag Info

New answers tagged

0

These days there is Mapbox's SimpleStyle. "properties": { // OPTIONAL: default "" // A title to show when this item is clicked or // hovered over "title": "A title", // OPTIONAL: default "" // A description to show when this item is clicked or // hovered over "description": "A description", ...


1

Use turf.js for this, the functions union and erase in particular. Make a union of all your polygons (or at least the ones that are within the current viewport), then erase the result from the polygon that covers the current viewport. The result will be the inverted selection you're looking for.


0

So not completely automated but my answer at for the following questions solves it quickly: Connecting polygon accidentally deleted - filling in the gap


0

One approach would be to create another layer with a polygon that roughly covers the hole and then use a geoprocessing operation, such as difference or clip to remove the overlap and leave just the jigsaw piece you want. The extent of the rough-cut polygon would limit the operation to the region of interest. ...


1

Pelias gets boundaries from external source (or form OSM but loaded via separate query) and join points with boundaries within ElasticSearch. Try this https://github.com/kiselev-dv/gazetteer/tree/develop/Gazetteer It uses pretty similar scheme (with some additions) as Pelias. Run gazetteer.jar from releases with: bzcat CH.osm.bz | java -jar gazetteer.jar ...


1

I think you should have a look at cshapes it... "provides historical maps of state boundaries and capitals in the post-World War II period". You can download a shapefile and query the data using the fields containing the year to evaluate how country shapes have changed over time. I found this website by first looking on the PennLibraries website.


0

Initially, I thought it's fine since I can see the shape of the map on QGIS and MapShaper but not geojson.io. But after I tried out the CRS options one by one on GIS. I just figured out I am using the wrong CRS. Nevertheless, thanks for the quick reply.


0

You can get -- feature.get('any') -- any geojson property and show in the popup. Take a look at this demo. You mixed up some points. So, first, get the coordinate to position the popup: var geometry = feature.getGeometry(); var coord = geometry.getCoordinates(); Note, there is no coordinate transformation. Second, prepare the popup content: var content ...


1

Transform your center point, use the internal and external Projection as cgarillo mentioned and then also define the Projection of your vectorLayer and your map: var center_coord = new OpenLayers.LonLat(lon, lat).transform("EPSG:4326", "EPSG:3857"); map.setCenter(center_coord, zoom); ... var geojsonLayer = new OpenLayers.Layer.Vector("GeoJSON", { ...


1

You have two issues. First, it is Point not point in the GeoJSON, ie, it is case sensitive. You can always use GeoJSONlint to check for the validity of GeoJSON, though it also shows up as an error in the developer console. Second, your link the cdn for the leaflet.css, needs to have the http: in front, ie, http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js -- ...


0

I found my method in ArcMap's Data Interoperability tools. I had to install the extension, but then everything worked flawlessly, allowing me to import everything within whatever folder I specified with the extension".json". It would be great to have another solution that didn't rely on the expensive extension that is only available to me under a 1-year ...


0

Supposing that geom is a shapely geometry object, you can use from shapely.geometry import * import json geojson = json.dumps(mapping(geom))


3

You need to import the GeoJSON plugn <dependency> <groupId>org.geotools</groupId> <artifactId>gt-geojson</artifactId> <version>${geotools.version}</version> </dependency> and then call it like this (a full example is here): public String geoData() { final GeometryBuilder builder = new ...


1

May be It depends up on back end for serving geojson. Just it varies for different back end serving capabilities. Just change the serving back end and observe the result. In leaflet the layer is load once from the back end and we can do more functionalities available for manipulating the layer.


2

Yes, it's a projection issue. OpenLayers defaults to geographic coordinates (lat/lon) so a simple "show me the thing" with it will paint it in geographics. GeoJSON.io wants to overlay things on top of web-mercator maps, so it reprojects your data into mercator, which stretches things out at the poles, just as you are seeing.


2

What is written above will loop through each element in each JSON object. Those are JSON objects so you want to treat them as the objects geometry and properties then simply reference them with dot notation. $.each(data.features, function (key, val) { geometry = val.geometry; properties = val.properties; alert (properties.place); }


0

You have to load Vincent JS parts with vincent.initialize_notebook() You need to transform the GeoJSON to TopoJSON (use Mapshaper) as Vincent support only TopoJSON (or I missed something too). See the official doc to understand TopoJSON The key DCNeighborhoodBoundariesWaPo in 'feature': "DCNeighborhoodBoundariesWaPo" was deduced from TopoJSON objects You ...


0

You need to style your data in MapBox Studio as a Style Project, rather than pulling it into mapbox.js. L.mapbox.featureLayer('mycrazydog.hz88h0k9') is for loading data uploaded in the mapbox editor, which is a different workflow entirely from MapBox Studio Source Projects. The distinction between the two is not as straightforward as it could be: use ...


2

You would have to be a on a fairly low-tech machine, or be zooming/panning via automation in order to have issues rendering only two XYZ layers. I suspect your issue is related to something else. If it was an actual issue, you could employ a bounds/extent trigger to stop rendering and halt network traffic for tiles that are out of view. That being said, ...


0

Not knowing vincent very well, could I offer that your map variable is just a string and not the resulting geojson you expect? Or you could validate the geojson at http://geojsonlint.com/


3

It seems you re mixing some concepts features[i] = new ol.format.GeoJSON( url: './testData.geojson') }; The above code can't work because the ol.format.GeoJSON API does not accept url as a parameter eg the official doc. You also try to loop on a GeoJSON call (if I consider above sample was intented for this) The normal way (there are more than one) ...


0

I found this library to be a great alternative to using arcpy.AsShape which has issues. I don't think ESRI wants to fully support geojson. https://gist.github.com/om-henners/4062925


0

PHP exec() should work, what error do you get? And what commands/utilities are you using to convert? For example with ogr2ogr: $command = "/usr/bin/ogr2ogr -f GeoJSON output.geojson input.shp"; exec($command); You should use escapeshellarg if any of these params are coming from user input


3

This should work. Which version of Leaflet are you using? Here, have a look at this jsFiddle. It is important you get the arrays right. First array is the polygon object [ in here the outer ring [ in here some [lat,lon],[,] close the outer ring], then the inner ring [ in here some [lat,lon],[,] close the inner ring ] close the polygon ]. scotland = ...


0

Loading and displaying GeoJSON with Leaflet has been pretty well detailed here: http://leafletjs.com/examples/geojson.html


0

This issue has resolved itself. I switched to OpenLayers 3 since asking. Data and feature projection can now be passed as options to the read and write function of the GeoJSON format class.


3

You can add the simplify-proportion option --simplify-proportion 0.999999 The parameter represents the proportion of points being kept (https://github.com/mbostock/topojson/wiki/Command-Line-Reference), so you want it at 1. However it needs to be under 1 so you need to make it close enough to 1 (depends on your input data) I am not sure the amount of ...


0

Although I am not cleaning up Polygons I have found a better approach. As users gather data for the polygon I think it may be better to simply collect all points and then use turf.concave to draw a Polygon. Technically it is not 100% accurate but given the jumpy GPS signals the solution is good enough for me.


0

You should take a look at this plugin : https://github.com/heigeo/leaflet.wms It allows you to get info on a popup for each 'feature' of a wms layer.


0

Found the problem. Somehow IE has problems with GeoJSON file containing characters like à or â etc.... Replacing those characters in the GeoJSON with normal characters (like a) does the trick. Chrome and FF seems to have no issues at all with these kind of characters.



Top 50 recent answers are included