Tag Info

Hot answers tagged

5

And, after a bit more reading the ogr2ogr help I found the answer more easily than I expected. ogr2ogr -f "PostgreSQL" PG:"dbname=db" spatialitedb -sql "SELECT * FROM table" -dialect spatialite -nln new_table EDIT: As suggested by user30184 in the comments a cleaner, simpler method is: ogr2ogr -f "PostgreSQL" PG:"dbname=db" spatialitedb ...


2

There is no direct equivalent, however you should be able to do something similar with a combination of RotateCoords() which rotates the geometry (in degrees, rather than radians), ShiftCoords() and ScaleCoords(). Here is an example, simplified from the test suite: SELECT AsText(RotateCoords(geom, 0)), AsText(RotateCoords(geom, 90.0)), ...


2

Standard OSM tiles are in Spherical Mercator (SRID=3857) so it will probably be easiest to build your grid using the same projection.


2

Yes it can be done with QGis. Using the QSpatiaLite Plugin "Manage your SpatiaLite databases within QGis" After installing the plugin you can run it. You will receive a series of messages/errors stating that you do not have a spatialite db. it will step you through getting one installed (choose a location for the file) and finally converting it to ...


1

It seems you miss the ST_relate function like in PostGIS. Search "relate" word in the reference functions for version 4.2. The signature will look like below : ST_Relate( geom1 Geometry , geom2 Geometry , patternMatrix String ) : Integer patternMatrix is the DE-9IM pattern. PS: If your spatialite version is old, ST_relate may be named relate


1

Solved! I was wrong when using the optional parameters syntax. SO, creating the spatialite database using the Spatialite format for the geometry column was my problem as it was defaulted to WKB format that was not appropriate for what I wanted to do. QgsVectorFileWriter.writeAsVectorFormat(layer, layer.name() + ".sqlite", ...


1

It is not the size of the database that makes it slow, it is that you select too much to render. Simplification can be a part of the solution but it will not be enough for making you happy. You can do lot of things once the data are in Spatialite. As you suggested, simplify "update lines set geometry=ST_Simplify(geometry,0.01);" Do the same but instead of ...


1

perhaps not as much an answer as a workaround? not sure what is going on with GetNextFeature in conjunction with SetFeature - but it would not iterate as expected. (a bug?) the below workaround seems to do the trick - by first getting a list of all feature FID's - then using GetFeature() in a new loop. def updatePt(): print 'updating...' ...



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