Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
A self-contained SQL database engine.
10
votes
Accepted
Merge all features in polygon shapefile with gdal
In order to merge all features into one, you should do:
ogr2ogr output.shp input.shp -dialect sqlite -sql "SELECT ST_Union(geometry) AS geometry FROM input"
where geometry is the special field used … in order to represent the geometry of the features in SQLite SQL dialect and input in the SQL statement is the input layer name. …
2
votes
How to merge close points into polygon?
Using GDAL >= 1.10.0 compiled with SQLite and SpatiaLite, you can:
Given a specific search radius (e.g. 5), calculate the buffers around your points:
ogr2ogr buffers.shp points.shp -dialect sqlite -sql … "SELECT ST_Buffer(geometry,5) from points"
Calculate the clusters:
ogr2ogr clusters.shp buffers.shp -dialect sqlite -sql "SELECT ST_Union(geometry) from buffers" -explodecollections
Wrap points.shp …
0
votes
How to update polygon longitude if negative?
So it should be:
ogr2ogr nodateline\new_polygons.shp org_polygon.shp -dialect sqlite -sql "SELECT ShiftCoords(geometry, 360, 0), * FROM org_polygon WHERE X(geometry)<0"
However, X(geometry) is not suitable …
2
votes
ogr2ogr sql - how to call file from a variable set in a loop in windows batch
If infile* are SpatiaLite datasources and intable* the table names, try with:
ogr2ogr -f sqlite -dsco SPATIALITE=YES " !outfile!.sqlite !infile1! -nln !outfile! … -dialect sqlite -sql "SELECT ST_Intersection(A.geometry, B.geometry) AS geometry, A.name, B.name FROM !infile2!.!intable2! A, !infile3!.!intable3! …
2
votes
sqlite version error with ogr2ogr
Source: http://www.gdal.org/ogr/ogr_sql_sqlite.html
So you need to build GDAL (>= 1.10) against SQLite (>= 3.6) and SpatiaLite (>= 3.0) in order to use the -dialect SQLite option. … In order to understand which versions of SQLite and (eventually) SpatiaLite you are using, simply execute:
ogrinfo foo.shp -dialect sqlite -sql "select sqlite_version()"
ogrinfo foo.shp -dialect sqlite …
10
votes
Multiple input shapefiles for ogr2ogr SQLite spatial operations
</OGRVRTLayer>
<OGRVRTLayer name="overlap">
<SrcDataSource>overlap.shp</SrcDataSource>
</OGRVRTLayer>
</OGRVRTDataSource>
Then you can execute:
ogr2ogr output.shp test.vrt -dialect sqlite …