Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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?

share|improve this question

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

2 Answers 2

You're at least missing the closing "

CREATE VIRTUAL TABLE test USING VirtualShape("C:\1. Project Data\1814\test", CP1252, 28356);
share|improve this answer
    
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.

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