Tag Info

Hot answers tagged

4

If you just want to plot the data in a desktop GIS software like QGIS, you need to make the data a "Feature Collection" as stated here: Features in GeoJSON contain a geometry object and additional properties, and a feature collection represents a list of features. Once I wrapped your GeoJSON code (above) with: {"type":"FeatureCollection", "features": ...


2

It really does depend on what you want the use to do with the web application. I asked a similar question here - Create interactive map with no server 1) If you want to just visually show the data then you could either load the data into a database (postgis, oracle etc) and put a geographic server (geoserver, mapserver, arcgis server) in front of that and ...


2

It's obvious here that you can't expect to get 200 MB from a server to a client in a reasonable amount of time. Your only options are to drastically simplify it (probably will resulting unusable information) or tiling it (either vector or raster tiling should work). What you do depends on what you know and what you want to achieve. Here's what I suggest, ...


2

title description marker-size marker-symbol marker-color stroke stroke-opacity stroke-width fill fill-opacity Mapbox.js uses the simplestyle spec. That's where you can find out more about defaults and accepted values. Adding a dashed line is a little more complicated, see dashArray in the leaflet documentation which will work with mapbox.js.


2

OpenLayers uses the EPSG:3857 coordinate system, in meters, and not the WGS84 system, in degrees, look at OpenStreetMap Wiki: EPSG:3857 But why use subprocess and ogr2ogr? 1) you can use directly the PostGIS ST_AsGeoJSON function: import psycopg2 conn = psycopg2.connect("dbname='osm' host='localhost' user='me'") cur = conn.cursor() # srid of the layer ...


1

You cannot apply this particular example without understanding the JSON format: your external file "file.json" is not an .json file A correct format would be (without var states = [:) { "type": "Feature", "properties": {"party": "Republican"}, "geometry": { "type": "Polygon", "coordinates": [ [ [ -84.32281494140625, ...


1

ogr2ogr should do this for you. Looks like you have multiple geometry types in the dataset, not sure how that will work out. You might have to filter out by geometry type. Below not tested. See docs linked to above for inputs and flags. ogr2ogr -f "GeoJSON" "sqlexport.geojson" "MSSQL:server=localhost\sqlexpress;database=tempdb;trusted_connection=yes;" -sql ...


1

The correct syntax is: ogr2ogr -f GeoJSON geojson.json Areas.kml You can also use togeojson (Online Maps moving forward, from KML to GeoJSON) togeojson Areas.kml > geojson.json


1

I tried your code example and it's working for me, I called it openlayers-example.html stuck it in my root folder next to the json1.json file and called it like http://localhost/openlayers-example.html. So you may need to double check that the json file is where you think it is and call it like: url: "http://localhost/json1.json" That said, I think ...


1

You can delete a field using OGR SQL and choosing an OGR format which supports the field deletion. Unfortunately GML doesn't support it, so you have to pass through another format, e.g. SHP: ogr2ogr temp.shp input.gml ogrinfo temp.shp -sql "ALTER TABLE temp DROP COLUMN field_to_drop" ogr2ogr -f GML output.gml temp.shp


1

you can do it using this SQL code SELECT row_to_json(fc) FROM ( SELECT 'FeatureCollection' As type, array_to_json(array_agg(f)) As features FROM (SELECT 'Feature' As type, ST_AsGeoJSON(lg.geom)::json As geometry, ( select row_to_json(t) from (select FIELD_1, FIELD_2, FIELD_N) t ) As properties FROM MY_TABLE_OR_VIEW As lg ) ...



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