On Wed, 13 Dec 2017 11:53:13 -0800 (PST), Kyle Felipe Vieira Roberto
wrote:
> Hello @Sandro
> my version is 4.3.0a
>
All right Kyle,
I've tested your issues using 4.3.0a, and here are
mi findings:
> first i tryed to use spatialite_tool to import, but it show a error
> when i use the [-s SRID]....
>
>> I assume you replaced 'SRID' with the srid-number to use?
>
> Yes..., i did it with 31983
>
spatialite_tool -i -shp testshp -d db.sqlite -t tbl -c CP1252 -s 31983
-----------------------------
SQLite version: 3.8.11.1
SpatiaLite version: 4.3.0a
Inserted 24323 rows into 'tbl' from 'testshp'
anything worked nicely and I was completely unable to see
any possible issue related to specifying "-s 31883"
> then, i tryied to use the SQL function ImportSHP but it show an error
> "spatialite.dbapi2.OperationalError: no such function: ImportSHP"
>
>> Did you set the environment variable SPATIALITE_SECURITY=relaxed,
>> befor calling the python script
>> - as shown of the command ImportSHP description at:
>>
http://www.gaia-gis.it/gaia-sins/spatialite-sql-latest.html
>
> Yes, and stil showing the error: spatialite.dbapi2.OperationalError:
> no such function: ImportSHP
>
my first attempt (without defining SPATIALITE_SECURITY)
sqlite3
-----------------
SQLite version 3.8.11.1 2015-07-29 20:00:57
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite> SELECT load_extension('mod_spatialite');
sqlite> SELECT spatialite_version();
4.3.0a
sqlite> SELECT ImportSHP('testshp', 'tbl', 'CP1252', 31983);
Error: no such function: ImportSHP
sqlite> .quit
my second attempt (this time correctly setting SPATIALITE_SECURITY)
set SPATIALITE_SECURIY=relaxed
sqlite3
-----------------
SQLite version 3.8.11.1 2015-07-29 20:00:57
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite> SELECT load_extension('mod_spatialite');
sqlite> SELECT spatialite_version();
4.3.0a
sqlite> SELECT ImportSHP('testshp', 'tbl', 'CP1252', 31983);
========
Loading shapefile at 'R15_11_WGS84' into SQLite table 'tbl'
BEGIN;
CREATE TABLE "tbl" (
...
"Geometry" BLOB);
COMMIT;
Inserted 24323 rows into 'tbl' from SHAPEFILE
========
24323
sqlite> .quit
once again, anything worked correctly without any issue,
so I'm unable to confirm your claims; the most reasonable
explanation is that you are not correctly setting
SPATIALITE_SECURITY=relaxed
note: properly setting an environment variable requires
using a different syntanx on Linux or Windows.
- on Linux: export "SPATIALITE_SECURITY=relaxed"
- on Windows: set SPATIALITE_SECURITY=relaxed
bye Sandro