[gdal-dev] Using VSIMEM properly

nagyrobi_r at yahoo.com nagyrobi_r at yahoo.com
Wed Jan 17 02:52:45 PST 2024



Hi all!

Maybe i am not using this tool properly. I am want to read the contents of a WFS service into an in memory sqlite database. Then i want to add a second table to it name it filter from a geojson, do an SQL query on the two tables, and write the result into a Postgresql database, this only using command line tools.

I ran this first, and no error




ogr2ogr -f "SQLite" /vsimem/temp.sqlite WFS:"http://localhost:8080/geoserver/wfs" ne:buildings -nln buildings -dsco SPATIALITE=YES -lco SPATIAL_INDEX=YES -nlt POLYGON

i ran this secondly and no error.




ogr2ogr -f "SQLite" -update -append /vsimem/temp.sqlite area_json.json -nln filter -dsco SPATIALITE=YES -lco SPATIAL_INDEX=YES

But then i tried: ogrinfo /vsimem/temp.sqlite i get ogrinfo failed - unable to open '/vsimem/temp.sqlite'.

And this was what i tried to do further on, but not working due to the reason above.



ogr2ogr PG:"dbname='postgres' host='172.17.0.2' port='5432' user='working_user' password='working_password'" -lco GEOMETRY_NAME=geom 
-lco GEOM_TYPE=geometry -lco SCHEMA=geospatial /vsimem/temp.sqlite  -sql "Select * from buildings join filter on st_intersects(buildings.geom,filter.geom)" -nln buildings_result -nlt polygon


Any ideas what i am using wrong, or how could i do this properly?




Kind regards,

Robert N
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20240117/aa143e7f/attachment.htm>


More information about the gdal-dev mailing list