When I go into a simple test file with 1 linestring, it tells me
"FDO-OGR Spatial Metadata detected"
and
spatialite> select CheckSpatialMetaData();
2
so it seems to pick up the fdo/ogr format correctly.
spatialite> select * from
geometry_columns;
lines|GEOMETRY|2|2|50000|WKB
Normal sqlite functions work fine. However, if I try using the
SpatiaLite functions, such as:
select AsText(GEOMETRY),NumPoints(GEOMETRY) from lines;
I just get null values.
This should work, no? Or am I missing something?
SpatiaLite automatically detects (at connect time)
if the DB contains any FDO-styled geometry.
In this case you'll get the message:
"FDO-OGR Spatial Metadata detected"
Please note: SpatiaLite automatically wraps any
FDO-OGR table using the VirtualFDO extension,
so that you actually have *two* different tables:
<table-name>
corresponds to the original FDO-OGR table (containing
exotic binary geometries, obviously not recognized
by SpatiaLite, and thus returning NULLs)
fdo_<table_name> [i.e. the table name prefixed by "fdo_"]
this is the VirtualFDO table, automatically enforcing
any required format conversion in order to return
valid SpatiaLite's own binary geometries.
So you *must* ignore the original FDO-OGR table in
SpatiaLite, using the "fdo_something" Virtual Table
instead.
e.g. assuming you have an FDO-OGR table named "lines",
then you have to perform the following query:
select AsText(GEOMETRY),NumPoints(GEOMETRY) from fdo_lines;
bye
Sandro
I get "SQL error: no such table: fdo_lines"
I'm using 2.3.0 (Debian binary), but I see that 2.3.1 "fixed a stupid
initialization bug disabling VirtualFDO". Does that mean I have to use
2.3.1 for this to work?
Is any of this documented anywhere?
Easy enough to get around, as you just have to add a column called
proj4text with the def in proj4 format.
Also, if you have this column but it's empty -> segmentation fault -
oops ;-(
I am using the Linux binary of libspatialite with sqlite 3.6.14 and
".load libspatialite"
I've also tried with 2.4, tried dropping fdo_lines and running "select
AutoFDOStart();" again, and tried several variations on the 2 spatial
tables, but always get the same result.
I decided to delete the downloaded libspatialite and go back to the
Debian 2.3.0 package. I was thinking I could convert my existing
linestrings by creating a new spatialite file, attaching my existing
file and doing something like
create table newlines as select feature_id, LineFromText(wkt_geometry)
from old.lines
but this fails with segmentation fault too, at exactly the same point,
so it seems spatialite doesn't like something in my file(s). Can
anyone suggest what might be causing this? I'm running out of ideas.