Tag Info

New answers tagged

1

Maybe try something like this? http://docs.geotools.org/stable/userguide/library/jts/geometry.html#creating-circularstring


0

After a lot of thinking and research here, I believe I found a solution. I would love to receive some peer review and feedback on this approach. I used ogr2ogr to generate a GeoJSON file from a PostGIS query using the CIRCULARSTRING function. ogr2ogr -s_srs EPSG:26910 -t_srs EPSG:26910 -f GeoJSON testArc.geojson PG:"host=localhost ...


2

Working (albeit cumbersome) solution to convert KML-/KMZ-files with <gx:Track>-Extension to gpx/csv/tcx, via Googles MyTracks-App. I tried to import a .kmz-file to QGIS, containing a GPS-track as <gx:track>-Element. (Track was recorded with MyTracks-App on Android. I only had the .kmz.) After numerous attempts, using various tools ...


0

I found some code here Is there a python option to "join attributes by location"? that uses Shapely and Fiona that outputted the points and then rearranged the code to output the polygon instead. This seems to be working on one of the 5 grid point buffer geographies and running through the ~80,000 grid points. import fiona from shapely.geometry ...


1

SQLite does not care about types and VARCHAR and NVARCHAR mean just the same for it http://stackoverflow.com/questions/3930501/difference-between-varchar-nvarchar-in-sqlite. The real problem is in the GDAL MapInfo driver that does not handle character encodings. There are some workarounds: Convert MapInfo data into MID/MIF format with ogr2ogr and convert ...


4

On Windows 7, you can activate Open Command Window Here as a context menu entry. On Windows XP, this can be added with the Windows XP PowerToys from Microsoft. See http://stackoverflow.com/questions/378319/windows-explorer-command-prompt-here for other solutions. Another way is to use the GDAL binaries from gisinternals. You double-click on the ...


7

There is, yes, using a combination of row_to_json, array_to_json, array_agg and ST_AsGeoJSON. I realize, on rereading your question, that you asked for ogr2ogr approach, but seeing as your source is Postgis, I thought you might appreciate a pure Postgres/Postgis approach. I have used this approach with Google Maps, so it works well if you need to create ...


4

Use SQL abilities, in particular IN operator instead of processing each GeoJSON after your SQL query. Your $ogr2ogr -f GeoJSON out.json "PG:host=localhost dbname=xxx user=xxx password=xxx" -sql 'select id, county, wkb_geometry from cities where id=47927526' would be $ogr2ogr -f GeoJSON out.json "PG:host=localhost dbname=xxx user=xxx password=xxx" ...


4

Yes, it is possible by using the -sql parameter. Add the new column and its value with SQL as SELECT 'value' as column_name Complete example which is using SpatiaLite as target database and writes value "batch_01" into a new column "my_source" for all rows: ogr2ogr -f SQLite -dsco spatialite=yes own_column.sqlite openstreetmap.sqlite -nln my_table ...


0

I fear you are out of luck with your current approach because this sentence from the GDAL wiki http://trac.osgeo.org/gdal/wiki/KML makes me understand that the GDAL KML driver does not support OGR Styles: Styling Until the driver supports the OGR simple feature style... The same wiki page gives advice for styling KML with XLS stylesheet. Consider ...


0

To solve this issue you must add -lco ENGINE=MyISAM to your ogr2ogr command. -lco NAME=VALUE: Layer creation option (format specific) GDAL ogr2ogr docs In this case this parameter sets storage engine for MySQL table(s). In MySQL 5.6 spatial indexes supports only on this storage engine. For indexing spatial columns, MyISAM supports both SPATIAL ...


0

Background Dom's comment solved my issue so I wanted to provide it as an actual answer (in case someone else is following the d3 tutorial). Make sure tools are installed correctly To do this, type which ogr2ogr and which topojson on the console. It should return /usr/local/bin/ogr2ogr and /usr/local/bin/topojson. Move all the files over (yes all of ...


2

I have same problem, my understanding is that the stored data is correct, if you consider it a binary utf-8 encoded data, to convert this data to nvarchar i wrote this (partially tested) UDF function in sql server: CREATE FUNCTION varbinUTF8_to_nvarchar ( @data VARBINARY(MAX) ) RETURNS NVARCHAR(MAX) AS BEGIN DECLARE @n INT DECLARE @buffer ...


0

Oh my! I just realized we were in Eastern Daylight Saving time when the position was taken so that is the correct result.



Top 50 recent answers are included