2

I'm fairly very new to spatialite, and am stuck on something very basic.

I'm creating a virtual table from a shapefile using virtualshape. This works fine when the shapefiles are in the same folder as spatialite.exe.

CREATE VIRTUAL TABLE test USING VirtualShape(test, CP1252, 28356);

I can't figure out how to specify an absolute path ie C:\1. Project Data\1814\test

CREATE VIRTUAL TABLE test USING VirtualShape("C:\1. Project Data\1814\test", CP1252, 28356);

Fails.

What's the syntax that's required here?

  • Very embarrassing, I had the filename incorrect (was pointing at mapinfo files instead of shapefiles). I literally spent hours trying to get this command to work. – Matthew Finlay Jul 18 '11 at 23:36
  • Matthew, I'm closing this question since it turns out that there is no problem. – underdark Jul 20 '11 at 9:29
2

You're at least missing the closing "

CREATE VIRTUAL TABLE test USING VirtualShape("C:\1. Project Data\1814\test", CP1252, 28356);
| improve this answer | |
  • apologies, typo in the question - not the command – Matthew Finlay Jul 18 '11 at 7:55
1

Your syntax appears to be correct. Check your path.

One way to debug this is to use spatialite-gui to create the the VirtualShape. If it works, right click the table name and select 'Show CREATE Statement'. Copy that and use it.

| improve this answer | |
  • This only shows a statement of the form CREATE TABLE "Test"("PK_UID" INTEGER PRIMARY KEY AUTOINCREMENT, "HEIGHT" DOUBLE, "RADIUS" DOUBLE, Geometry BLOB) – Matthew Finlay Jul 18 '11 at 23:28
  • That's not a virtual shapefile. Most likely, you already have a table named test. Rename or drop the table "test" and try again. Make sure you're not importing the shapefile instead of creating a virtual one. – Sean Jul 19 '11 at 13:27

Not the answer you're looking for? Browse other questions tagged or ask your own question.