[postgis-users] GeometryCollection with GEOMETRYCOLLECTIONM, POINTM etc.. value in constructor.
Rémi Cura
remi.cura at gmail.com
Wed Dec 18 00:35:32 PST 2013
Hey,
using this in sql :
SELECT ST_AsText(ST_GeomFromText(
'GEOMETRYCOLLECTIONM(
POINTM(10 10 100),
LINESTRINGM(0 50 100, 100 50 100),
POLYGONM((25 25 100,75 25 100,75 75 100,25 75 100,25 25 100),(45 45 100,55
45 100,55 55 100,45 55 100,45 45 100))
)'
))
It gives you the expected output.
I would guess it is the java function you are using that is faulty (the
geometrycollection constructer).
Cheers,
Rémi-C
2013/12/18 Baris Ergun <barisergun75 at gmail.com>
> Hello
>
> I create a GeometryCollection as below
>
> GeometryCollection coll = new GeometryCollection(
> "SRID=-1;GEOMETRYCOLLECTIONM(POINTM(10 10
> 100),LINESTRINGM(0 50 100, 100 50 100),POLYGONM((25 25 100,75 25 100,75 75
> 100,25 75 100,25 25 100),(45 45 100,55 45 100,55 55 100,45 55 100,45 45
> 100)))"));
>
> when I reprint the coll.toString() I see that my geom string is changed to
> below :
>
> "SRID=-1;GEOMETRYCOLLECTIONM(POINT(10 10 100),LINESTRING(0 50 100, 100 50
> 100),POLYGON((25 25 100,75 25 100,75 75 100,25 75 100,25 25 100),(45 45
> 100,55 45 100,55 55 100,45 55 100,45 45 100)))"
>
> As you can see GEOMETRYCOLLECTIONM is preserved but POINTM LINESTRINGM and
> POLYGONM is changed to POINT LINESTRING and POLYGON . And because of this I
> get cannot mix dimensionality when I am trying to insert this geom to
> database.
>
> I have tried this with postgis jdbc driver 1.1.5; 1.3.3 and 2.0.1
> versions.
>
> This is a test written in datanucleus orm for geospatial extensions and
> the test is run against the below table (create script) in postgresql db.
>
> CREATE TABLE public.samplepggeometrycollectionm
> (
> samplepggeometrycollectionm_id integer NOT NULL DEFAULT
> nextval('samplepggeometrycollectionm_samplepggeometrycollectionm_id_seq'::regclass),
> geom geometry(GeometryCollectionM),
> id bigint NOT NULL,
> name character varying(255),
> CONSTRAINT samplepggeometrycollectionm_pkey PRIMARY KEY
> (samplepggeometrycollectionm_id)
> )
> WITH (
> OIDS=FALSE
> );
> ALTER TABLE public.samplepggeometrycollectionm
> OWNER TO postgres;
>
> Awaiting ur suggestions.
> --
> Baris
>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20131218/f73ddb17/attachment.html>
More information about the postgis-users
mailing list