SHP to SPATIALITE batch
946
Global Mapper UserTrusted User
Hi there,
Is there a way to convert shp files to spatialite db? I ll need to have one spatialite for each shp .
Thanks,
Remi
Is there a way to convert shp files to spatialite db? I ll need to have one spatialite for each shp .
Thanks,
Remi
Comments
-
Hi Remi,
We can export vector data to a spatialite DB, but not as a batch conversion. I believe you could write a script to to this however:
Global Mapper Scripting Reference -
Hi Remi,
Here is a sample script that provides a basic outline for you to use:GLOBAL_MAPPER_SCRIPT VERSION=1.00 SET_LOG_FILE="C:\DATA\CONVERT.LOG" UNLOAD_ALL // Loop over all shapefiles in a folder and convert them DIR_LOOP_START DIRECTORY="C:\DATA\SHP\" FILENAME_MASKS="*.shp" RECURSE_DIR=NO // Import a shapefile. IMPORT FILENAME="%FNAME_W_DIR%" TYPE=SHAPEFILE // Export the data to a Spatialiate database. EXPORT_VECTOR FILENAME="%DIR%%FNAME_WO_EXT%_OUT.sqlite" TYPE=SPATIALITE \ SDB_TABLE_NAME=%FNAME_WO_EXT% // Unload the loaded data UNLOAD_ALL // End the loop DIR_LOOP_END
Cheers,
Bob -
Thanks Bob!
All the best
Categories
- 12.7K All Categories
- 5.6K Features Discussion
- 342 Downloading Imagery
- 1.3K Elevation Data
- 380 Georeferencing Imagery Discussion
- 627 GM Script Language
- 52 User Scripts
- 113 GPS Features
- 414 Projection Questions
- 819 Raster Data
- 1.3K Vector Data
- 6.6K Support
- 177 Announcement and News
- 908 Bug Report
- 558 SDK
- 1.2K Suggestion Box
- 3.7K Technical Support
- 562 Other Discussion
- 129 GIS Data Sources
- 27 Global Mapper Showcase
- 233 How I use Global Mapper
- 107 Global Mapper Forum Website