Tag Info

Hot answers tagged

3

The most robust way to do this, is to use GDAL's ogr2ogr functionality. Since you know your datatypes, you can specify them in VRT file. The documentation has this to say about setting field types: Field (optional, from GDAL 1.7.0): One or more attribute fields may be defined with Field elements. If no Field elements are defined, the fields of the ...


3

Theoretically you can do it with ogrinfo, SQLite SQL dialect and -sql parameter. ogrinfo -dialect sqlite -sql "delete from OGRGeoJSON where name not like 'B%'" json.json However, it does not work because for GDAL existing GeoJSON files are read-only. But try it with shapefile and you will see that it works. ogrinfo -dialect sqlite -sql "delete from json ...


2

I think you need to read features using format. data=' your GeoJSON goes here '; var activationLayer = new ol.layer.Vector( { title: 'Activation Boundary', source: new ol.source.GeoJSON(), style: new ol.style.Style( { stroke: new ol.style.Stroke( { color: 'red', width: 2 }) ...


2

If you use geojson.io, it will not mess up the property data types. Import the csv file into there, then export it out as geojson.


2

A MultiPoint, by definition, comprises several points, so geom = '{"type": "MultiPoint", "coordinates": [[100.0, 0.0], [101.0, 1.0]]}' geom = ogr.CreateGeometryFromJson(geom) # iterate through the points for i in range(0, geom.GetGeometryCount()): g = geom.GetGeometryRef(i) print "%d,%d" % (g.GetX(), g.GetY()) 100,0 101,1 as explained in Iterate ...


2

Yup, it's a bug. You can simplify it with: SELECT ST_AsText( ST_GeomFromGeoJSON('{"type":"LineString","coordinates":[[0,0],[1,1],[1,1],[2,2]]}')); st_astext ------------------------- LINESTRING(0 0,1 1,2 2) Which should be LINESTRING(0 0,1 1,1 1,2 2). You should file a ticket to get it fixed. If you don't have a user ID, follow these ...


1

No workaround should be needed. What you did in the first place is the right way. Take this GML as input: <?xml version="1.0" encoding="utf-8" ?> <ogr:FeatureCollection xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://ogr.maptools.org/ mixed_points.xsd" xmlns:ogr="http://ogr.maptools.org/" ...


1

Taking CSV data (test.csv) from Devdatta Tengshe's answer: Latitude,Longitude,Name, Ht 48.1,0.25,"First point", 3 49.2,1.1,"Second point", 56 47.5,0.75,"Third point", 67 In QGIS you need a *.csvt file (test.csvt) for considering data types. In this case: Real, Real, String, Integer At the next imagen it can be observed that the csv layer 'type ...


1

http://ogre.adc4gis.com/ Supports CSV and a number of other extensions.


1

You can convert shapfiles to geojson using shapefile-js library or other similar libraries, in the browser without making any server calls. then use that geojson data with Turf.js


1

What are you importing into? ogr2ogr would be my choice for converting shapefiles into various other formats, including GeoJSON: ogr2ogr -f "GeoJSON" output.json input.shp Turf is 100% javascript by the way, so there is no turf format apart from GeoJSON (also referred to as a FeatureCollection in the docs and modules): Turf uses GeoJSON for all ...



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