Tag Info

Hot answers tagged

5

Geotools as a support for geojson. See here. Otherwise, you could simply use a typical JSON parser (such as json-simple) together with the geoJSON spec, which is really easy to use. The best solution depends on what you want to do with the parsed information.


4

There are couple of alternatives. First one it to use the -select option that is documented on the manual page http://www.gdal.org/ogr2ogr.html -select field_list: Comma-delimited list of fields from input layer to copy to the new layer. A field is skipped if mentioned previously in the list even if the input layer has duplicate field names. ...


4

A simple approach is to make one if you can't find one. Get the free OrdnanceSurvey OpenData Boundaries dataset. This contains several boundary datasets in either Shapefile or MapInfo formats. Identify the one you need and load it into a competent GIS (QGIS is free). Then export as GeoJson. Alternatively use org2ogr (also free) to convert it on the ...


3

While the answer that you have posted works, it doesn't really get to the root of the issue. The error indicates that you are trying to load the JSON from a a location that is not on the same domain. In the OP's case, the application is not being hosted from a webserver, and is trying to load the JSON from the file system. The real solution for this is to ...


3

I also haven't been able to get L.mapbox.featureLayer() to load vectors I've uploaded to MapBox. Vector Tile source .mbtiles files are no longer .geojsons but have been converted into a bunch of tiled .svgs combined into one .mbtiles file, so I'm not sure if mapbox.js has the ability to render vector .mbtiles the same was it renders hosted .geojson files. ...


2

Try something like this, sorry had to replace your variables with real values so I could test, but should be easy enough for you to replace back with what you had. Also note I replace your ST_MakeBox2D/ST_SetSRID with ST_MakeEnvelope which is shorter and generally more accurate. WITH c AS (SELECT -88.505 As topLon, 41.8046 As topLat, -88.405 As botLon, ...


2

Geoserver is an OGC compliant Web server which can serve out data in OGC's web services, namely WMS, WFS & WCS. You want to get GeoJSON Tiles, and use it in your Leaflet Map. GeoJSON tiles are not a OGC standard, and GeoServer can not serve out GeoJSON Tiles. TileStache on the other hand, can serve out GeoJSON Tiles from ESRI Shapefile, PostgreSQL, ...


2

Yes. You have to send your data from the client to the server and let server-code handle the database-insert. You should look into HTTP POST through jQuery or other libraries as a way to asynchronously send your data from the client to the server.


2

The use of && will return quicker than ST_Intersects, as it is only checking bounding boxes, which is the first stage of any spatial intersection query, via the bounding boxes stored as part of R-Tree indexing (technically a GIST index in Postgis, but the bounding box is still used in index construction). As, the second stage, the actual intersection ...


1

for a GeoJSON featureCollection, you could do something like this: var myGeoJSON = { "type": "FeatureCollection", "features": [ { "type": "Feature", "properties": { "name": "hi", "num": 9, "other": null }, "geometry": { "type": "Point", "coordinates": [ 23.203125, ...


1

I would download data from here if nothing works and convert shapefiles into geojson.


1

what about L.mapbox.featureLayer('your_id').addTo(map); Just tested it again and it works fine. Have you added these two lines with the up to date API and CSS? <script src='https://api.tiles.mapbox.com/mapbox.js/v2.1.5/mapbox.js'></script> <link href='https://api.tiles.mapbox.com/mapbox.js/v2.1.5/mapbox.css' rel='stylesheet' />


1

Yes, regex is supported with the =~ operator. For example, [name=~'^.{12,}$'] { text-name: ''; } will remove labels above a certain length. You can find this and more examples in this Advanced CartoCSS techniques slide deck.


1

To write a geojson object to a temporary file this function can be used: import geojson import tempfiile def write_json(self, features): # feature is a shapely geometry feature geom_in_geojson = geojson.Feature(geometry=features, properties={}) tmp_file = tempfile.mkstemp(suffix='.geojson') with open(tmp_file[1], 'w') as outfile: ...


1

To parse or deserialize geojson in Java REST webservice, i prefere to use geojson-jackson , which integrates very nicely with jackson.


1

This is not directly available through the API. The PrintTask can be used to get the Web_Map_as_JSON. map.on("load", function(){ require(["esri/tasks/PrintTask", "dojo/_base/json"], function(PrintTask, JSON){ var printTask = new PrintTask(); var Web_Map_as_JSON = JSON.toJson(printTask._getPrintDefinition(map)); }); });


1

"handle" is in the properties of the feature, so it just needs to be d.properties.handle Try: feature.attr("class", function (d) { return "code " + d.properties.handle; });



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