Tag Info

Hot answers tagged

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


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) ...


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 = ...


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


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


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); }


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.


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

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


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

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.


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.



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