Hi,
I have problems with GeomFromFGF() function.
I have exported geometries from AutoCAD Map to SQLite Spatial (FDO SQLite), and they load and display correctly in QGIS. I also did a Check Validity with GEOS and QGIS all it reports that all features in layer are valid.
But when I try to use it with spatial functions via SpatiaLite I get errors and crashes:
for example with: ST_PointOnSurface(GeomFromFGF(Geom)),
or with ST_Within().
Simple query SELECT AsWKT(GeomFromFGF(Geom)) AS WKT FROM table WHERE FeatID = 2 returns:
MULTIPOLYGON(
(
(
653074.9 5003366.259999999,
0 653069.4499999999,
5003366.7 0,
653058.26 5003367.82,
0 653056.79,
5003367.929999999 0,
653068.6899999999 5003410.07,
0 653079.31,
5003447.66 0,
653080.5699999999 5003452.339999999,
0 653096.
8299999999 )
),
(
(
0 0,
0 0,
0 0,
0 106455133957404600000000000000000000000000000000000000000000000000000000000,
0 0,
220013634712918100000000000000000000000000000000000000000000000000000 769843823860227700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000,
220119001716826400000000000000000000000000000000000000000000000000000 220013652603593900000000000000000000000000000000000000000000000000000,
260852630201480700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0,
220013652603593900000000000000000000000000000000000000000000000000000 769843823860227700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000,
106457026406292900000000000000000000000000000000000000000000000000000000000 0,
772533753723214800000000000000000000000000000 156436313205679400000000000000000000000000000000000000000000000000000000000000000000000000000000000
)
)
)
While for the same feature (FeatId = 2) QGIS shows this:
Polygon Z (
(
653074.90000000002328306 5003366.25999999977648258 0,
653069.44999999995343387 5003366.70000000018626451 0,
653058.26000000000931323 5003367.82000000029802322 0,
653056.7900000000372529 5003367.92999999970197678 0,
653068.68999999994412065 5003410.07000000029802322 0,
653079.31000000005587935 5003447.66000000014901161 0,
653080.56999999994877726 5003452.33999999985098839 0,
653096.82999999995809048 5003447.87999999988824129 0,
653078.81000000005587935 5003378.63999999966472387 0,
653075.55000000004656613 5003366.12000000011175871 0,
653074.90000000002328306 5003366.25999999977648258 0
)
)
Even when I try to execute same query twice in a row I sometimes get different results:
spatialite>SELECT FeatId, AsWKT(GeomFromFGF(Geom)) AS WKT FROM table WHERE FeatId = 2;
2|MULTIPOLYGON(((653074.9 5003366.259999999,0 653069.4499999999,5003366.7 0,653058.26 5003367.82,0 653056.79,5003367.929999999 0,653068.6899999999 5003410.07,0 653079.31,5003447.66 0,653080.5699999999 5003452.339999999,0 653096.8299999999)),((0 0,0 0,0 0,0 0,0 0,0 0,nan 0,0 0,0 0,0 0,nan 0)))
spatialite>SELECT FeatId, AsWKT(GeomFromFGF(Geom)) AS WKT FROM table WHERE FeatId = 2;
2|MULTIPOLYGON(((653074.9 5003366.259999999,0 653069.4499999999,5003366.7 0,653058.26 5003367.82,0 653056.79,5003367.929999999 0,653068.6899999999 5003410.07,0 653079.31,5003447.66 0,653080.5699999999 5003452.339999999,0 653096.8299999999)),((0 0,0 -4260607557632,0 598008221088484700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000,0 0,-190359804756584700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0,0 0,nan 0,0 0,0 0,0 0,nan 0)))
spatialite>SELECT FeatId, AsWKT(GeomFromFGF(Geom)) AS WKT FROM table WHERE FeatId = 2;
2|MULTIPOLYGON(((653074.9 5003366.259999999,0 653069.4499999999,5003366.7 0,653058.26 5003367.82,0 653056.79,5003367.929999999 0,653068.6899999999 5003410.07,0 653079.31,5003447.66 0,653080.5699999999 5003452.339999999,0 653096.8299999999)),((0 0,0 -4365060407296,0 598008221088484700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000,0 0,-190359804756584700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0,0 0,nan 0,0 0,0 0,0 0,nan 0)))
-- Srdačan pozdrav / Kind regards,
Vedran Stojnović.