Tag Info

New answers tagged

2

Look at the samples on the specification site. You'll need to write a script in the language of your choice that will get you from [ {"date":"2014-09-25","time":"20:49:09","lat":"53.269","lon":"6.935","depth":"3.0","place":"Meedhuizen","mag":"1.5","type":"GH","last":"True"}, ...


3

Look at Are there any online WKT editors? GeoJSON and WKT OpenLayers vector formats GeoJSON geojson.io GeoJSONLint GeoJSON viewer and others WKT Wicket


0

It's actually a bug in GeoServer. GeoServer in it's WFS implementation specifies the order of coordinates for different versions and projection definitions (link) but GeoJSON states specifically that the order is always the same (x,y,z or lon,lat,alt). See the spec.


2

Turns out it is as easy as this: MIMETYPE "application/json; subtype=geojson; charset=utf-8" Without the setting, no content encoding is returned by the server.


1

Check out compositing operations, possibly dst-in. Your carto might look something like this: #neighborhoods { line-color: #ccc; polygon-opacity: 1; polygon-comp-op: dst-in; }


1

It can be done easily with GDAL. Here is a test with ogrinfo and GeoJSON file "multipoly.json" C:\temp\poista>ogrinfo multipoly.json -ro -dialect sqlite -sql "select centroid(st_union(geometry)) as geometry from OGRGeoJSON" INFO: Open of `multipoly.json' using driver `GeoJSON' successful. Layer name: SELECT Geometry: Unknown (any) Feature Count: 1 ...


2

You on Linux? If so, switch all the single quotes for double quotes and vice versa like this: ogr2ogr -f GeoJson -where 'neighborhood IN ("Lower East Side", "Greenwich Village", "Columbia St", "Financial District", "Flatiron District", "Williamsburg", "West Village", "Central Park", "Upper West Side", "Navy Yard", "Gramercy", "Stuyvesant Town", "Upper East ...


-1

That does not seem as valid geojson according to http://geojsonlint.com/. You should remove the last comma and add ]} to what you posted.


2

In Python: import json #(geojson also fine) json_data=open('a.geojson') data = json.load(json_data) print len(data['features'])


5

If you have GeoJson that looks like that on the wikipedia page var json={ "type": "FeatureCollection", "features": [ { "type": "Feature", "geometry": { "type": "Point", "coordinates": [102.0, 0.6] }, "properties": { "prop0": "value0" } }, { "type": "Feature", "geometry": { "type": "LineString", ...


1

If you plan to use Mapserver and PostGIS, you may edit the spatial database using WFS-T provided by TinyOWS add-on: link to the docs There is also a project called dirt-simple-postgis-http-api (former PostGIS RESTful Web Service Framework), but it's read-only. For full CRUD capabilities, you will have to create a backend service from scratch. ...


2

If you're looking for geojson support, I would go for builtin PostgreSQL capabilities instead of parsing it with PHP. It's available since version 9.3 and it works like charm with Leaflet library. You'd also probably need to do some routing if you want to build a RESTful app and you might find any of these PHP framework handy.


0

I'm not sure if your question is adequate because it's not really specific or clear. Any way I suggest you: 1) Simplify your code. Start with just one layer e check if it is working. Add a second and check again. Do the same for all your layers. 2) Do not let you error option in the ajax function empty. At least include a console.log so you can see what is ...


3

You must first extract the geometries from the JSON before merging them. This should do the trick: WITH source AS( SELECT '{"type": "FeatureCollection", "features": [{ "geometry": {"type": "MultiPolygon" , "coordinates": [[[[-184557.61264043, 384896.54253906], [-134666.391073443, 239616.414560895], [-308616.222736376, 238788.813082666], ...


0

It looks like ogr2ogr may not be respecting the order of the vertices in the dataset, which is causing the artefacts, as the line is incorrectly jumping between vertices which aren't supposed to be joined. I just tried downloading the JSON directly by querying the REST endpoint and converted to shapefile using the ArcGIS JSON to Features tool, and the ...


1

If you are exporting your geojson from postgis, you can use the ST_MULTI function to ensure that the feature will be a MULTIPOLYGON if it's a polygon, a MULTILINESTRING if its a linestring or a MULTIPOINT if its a point SELECT ST_AsGeoJSON(ST_Multi(geom))::json FROM table WHERE id = 0; Edit: the technique to output a featureCollection in geoson from ...


2

You can convert all your data into multipolygons with ogr2ogr by defining "new layer type" with -nlt MULTIPOLYGON. However, I am not sure if the result is exactly what you believe when multipolygon has only one part. This is a triangle as polygon { "type": "FeatureCollection", "features": [ { "type": "Feature", "properties": { }, "geometry": { "type": ...


1

FYI, GeoJSON support is one of the new features in MySQL 5.7.5, which is to be released soon I think. See http://dev.mysql.com/doc/relnotes/mysql/5.7/en/news-5-7-5.html for more information.


0

Someone exported French cities, departments and regions data as geojson, from the official National Geographic Institute (IGN). Free to use and open (Open Licence, compatible with CC-BY 2.0) : https://github.com/gregoiredavid/france-geojson


1

See example https://github.com/bmcbride/bootleaf var boroughs = L.geoJson(null, { style: function (feature) { return { color: "black", fill: false, opacity: 1, clickable: false }; }, onEachFeature: function (feature, layer) { boroughSearch.push({ name: layer.feature.properties.BoroName, source: "Boroughs", id: L.stamp(layer), bounds: layer.getBounds() }); } ...


0

The GeoJSON needs to be formatted like a javascript object variable. So rename the file extension of the geojson file to .js (ie. worldmap.js) and open it in your text editor. Add: var worldMap = [ in front of the data already in the file, and then a ]; at the end (thus turning it into a regular JSON object.) Load the file like you would load a ...


1

Ref: http://leafletjs.com/reference.html#icon pointToLayer: function(feature, latlng) { var smallIcon = L.icon({ iconSize: [27, 27], iconAnchor: [13, 27], popupAnchor: [1, -24], iconUrl: 'leaflet/icons/' + feature.properties.pcp + '.png' }); return ...


2

The file sizes you are using are far too big to be using GeoJSON rendered as vectors on the client-side. It will be slow to download and also bog down the browser as it struggles to render all of the geometry. The best practice for medium to large size datasets is to render them as images on the server and send those images to the client. I build a lot of ...


2

Leaflet has a useful filter function that could easily be triggered based on some event. Alternatively, mapbox.js which is built on top of leaflet, has a useful setFilter function that you can apply to the a geojson feature layer.


0

If you could not find the solution yet here is one: http://gis.xyz/leaflet.html# var owsrootUrl = 'http://217.8.255.188:8080/geoserver/opengeo/ows'; var defaultParameters = { service : 'WFS', version : '2.0', request : 'GetFeature', typeName : 'opengeo:evernote_geom', outputFormat : 'text/javascript', format_options : ...



Top 50 recent answers are included