About running spatialite command via ogr

24 views
Skip to first unread message

Andrea Borruso

unread,
Dec 30, 2020, 3:18:26 AM12/30/20
to SpatiaLite Users

Hi all,
if I run a command as

ogrinfo ./db.sqlite -sql "SELECT ST_Cutter(NULL, 'a', NULL, NULL, 'b', NULL, 'out', 1, 1);"

am I introducing significant bottlenecks?

Is it always better to run it via sqlite?

echo "SELECT ST_Cutter(NULL, 'a', NULL, NULL, 'b', NULL, 'out', 1, 1);" | sqlite3 ./db.sqlite

Or are they somehow almost coincident?

Thank you

a.fu...@lqt.it

unread,
Dec 30, 2020, 3:38:26 AM12/30/20
to spatiali...@googlegroups.com
Ciao Andrea,

I haven't any objective experience about this, but
speaking in the most general way any intermediate
abstraction layer we'll introduce in our tool chains
will surely imply some bottleneck.

however the exact impact of such bottlenecks could
easily be irrelevant in many cases.

just a stupid example: building a complex Topology
could realistically require several hours of internal
computations. a very badly implemented abstraction
layer could possibly add several more seconds due to
its poor design choices. where is the problem ?

short conclusion: if you are satisfied and well
accustomed with GDAL/OGR I see absolutely no
contraindications.

bye Sandro



mj10777

unread,
Dec 30, 2020, 5:36:49 AM12/30/20
to SpatiaLite Users
On Wednesday, 30 December 2020 at 09:38:26 UTC+1 sandro furieri wrote:
On Wed, 30 Dec 2020 00:18:26 -0800 (PST), Andrea Borruso wrote:
> Hi all,
> if I run a command as
>
> ogrinfo ./db.sqlite -sql "SELECT ST_Cutter(NULL, 'a', NULL, NULL,
> 'b',
> NULL, 'out', 1, 1);"
>
> am I introducing significant bottlenecks?
>
> Is it always better to run it via sqlite?
>
> echo "SELECT ST_Cutter(NULL, 'a', NULL, NULL, 'b', NULL, 'out', 1,
> 1);" | sqlite3 ./db.sqlite
This (spatialite specific) command will probably fail, since the spatialite extension has not been loaded. 
ogrinfo should load the spatialite extension when needed. 
The same is true if you replace 'sqlite3' with the 'spatialite' command tool. 

andy

unread,
Dec 30, 2020, 5:51:00 AM12/30/20
to spatiali...@googlegroups.com
Hi mj10777,

On Wed, 30 Dec 2020 at 11:36, 'mj10777' via SpatiaLite Users <spatiali...@googlegroups.com> wrote:
This (spatialite specific) command will probably fail, since the spatialite extension has not been loaded. 
ogrinfo should load the spatialite extension when needed. 
The same is true if you replace 'sqlite3' with the 'spatialite' command tool. 

it works both, because to use them I must load the extension.
I gave it as an implied, but you were right to point it out, thanks. 


--
___________________

Andrea Borruso
website: https://medium.com/tantotanto
38° 7' 48" N, 13° 21' 9" E, EPSG:4326
___________________

"cercare e saper riconoscere chi e cosa,
 in mezzo all’inferno, non è inferno, 
e farlo durare, e dargli spazio"

Italo Calvino
Reply all
Reply to author
Forward
0 new messages