Writing linestring and getting back linestring25

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Writing linestring and getting back linestring25

mccorb
I am creating a new sqlite file and writing a new layer and feature. When i write a linestring to the file everything works fine. I look at it in an SQLite browser app and the geometry_type is 2. However when I reopen it I get a linestring25d geometry type.

From what I can tell I can use this exactly the same way as a linestring feature and just ignore the Z coordinate. Is this correct?

I am confused why the file I created shows the geometry_type in the file as linestring (via the sqlite file browser I am using to inspect the tables directly) but I get back a linestring25d. I then I open up another file someone gave me and it also shows the type as a linestring and it returns a linestring and not linestring25d which makes me suspect it is something I am doing when I write the data as opposed to reading it.

I would like to better understand this and, if possible, have a little better control over it than what I know how to do right now. Perhaps some option on the file open or layer create that can coerce a linestring to stay a linestring.

I haven't tested but I would be pretty sure that I would end up with the same results for points and polygons also. I just happened to test the liniestring first.

thanks
Reply | Threaded
Open this post in threaded view
|

Re: Writing linestring and getting back linestring25

Even Rouault-2
Le lundi 25 août 2014 20:35:34, mccorb a écrit :
> I am creating a new sqlite file and writing a new layer and feature. When i
> write a linestring to the file everything works fine. I look at it in an
> SQLite browser app and the geometry_type is 2. However when I reopen it I
> get a linestring25d geometry type.

Without reproducable code snippet, it is hard to tell...

My best guesses :

With regular SQLite databases (i.e. not spatialite), there's no consistency
check done between the layer geometry type and each feature geometry type, so
you could actually write every geometry you want in the layer.

By chance, do you use the AddPoint(double x, double y) Java API ? If so, then
it might be surprising, but it is an alias of AddPoint(x,y,0)...
Use instead AddPoint_2D()


>
> From what I can tell I can use this exactly the same way as a linestring
> feature and just ignore the Z coordinate. Is this correct?
>
> I am confused why the file I created shows the geometry_type in the file as
> linestring (via the sqlite file browser I am using to inspect the tables
> directly) but I get back a linestring25d. I then I open up another file
> someone gave me and it also shows the type as a linestring and it returns a
> linestring and not linestring25d which makes me suspect it is something I
> am doing when I write the data as opposed to reading it.
>
> I would like to better understand this and, if possible, have a little
> better control over it than what I know how to do right now. Perhaps some
> option on the file open or layer create that can coerce a linestring to
> stay a linestring.
>
> I haven't tested but I would be pretty sure that I would end up with the
> same results for points and polygons also. I just happened to test the
> liniestring first.
>
> thanks
>
>
>
> --
> View this message in context:
> http://osgeo-org.1560.x6.nabble.com/Writing-linestring-and-getting-back-li
> nestring25-tp5158219.html Sent from the GDAL - Dev mailing list archive at
> Nabble.com.
> _______________________________________________
> gdal-dev mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/gdal-dev

--
Spatialys - Geospatial professional services
http://www.spatialys.com
_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev