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);


What's the syntax that's required here?

closed as not constructive by underdark Jul 20 '11 at 9:27

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 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

You're at least missing the closing "

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

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.

  • 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.