[Geoserver-devel] 3D geometries & property files

Hi,

I am trying to write some unit tests in geoserver that use 3d geometries, and was looking for examples but cannot actually find much 3d geometry testing on the geoserver side.

I tried using property files with WKT, however the WKT format for 3d geometries doesn't seem to be supported, for example a 3d point would be encoded as
Point Z (x y z)
Am I correct to say this is not supported yet? I want to implement this for property files. Anyone have any experience in how to do something like that?

Cheers
Niels

Hi Niels,

COrrect, there are not many tests if any that test 3d/2.5d data through the pipeline. Martin did a bunch of stuff recently to start testing this and soon tests should start showing up in GeoServer. We also discussed what support for 2.5d data we get with property datastore.

As far as I know the JTS WKT reader will respect a third coordinate. For instance if i parse POINT(1 2 3) I do get back a Point that has an underlying coordinate that maintains a z value of 3. Not sure about the other geometries but the impression I got from Martin is that its maintained. Writing I believe might be a different story.

Long story short through I believe you can use property datastore as it is today to test 2.5d as long as you are not doing transactions.

-Justin

On Mon, May 28, 2012 at 1:15 AM, Niels Charlier <niels@anonymised.com> wrote:

Hi,

I am trying to write some unit tests in geoserver that use 3d
geometries, and was looking for examples but cannot actually find much
3d geometry testing on the geoserver side.

I tried using property files with WKT, however the WKT format for 3d
geometries doesn’t seem to be supported, for example a 3d point would be
encoded as
Point Z (x y z)
Am I correct to say this is not supported yet? I want to implement this
for property files. Anyone have any experience in how to do something
like that?

Cheers
Niels


Live Security Virtual Conference
Exclusive live event will cover all the ways today’s security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/


Geoserver-devel mailing list
Geoserver-devel@anonymised.comsts.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel


Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.

As far as I know the JTS WKT reader will respect a third coordinate. For instance if i parse POINT(1 2 3) I do get back a Point that has an underlying coordinate that maintains a z value of 3. Not sure about the other geometries but the impression I got from Martin is that its maintained. Writing I believe might be a different story.

I checked and this definitely doesn't work. (Converter can't do this).

Also, according to the official WKT syntax, if there is a z coordinate it should be written as

point z (1 2 3)

Cheers
Niels

The JTS WKTReader does respect Z ordinates in WKT, and will populate the Z field in the Coordinate objects created. This works for all geometries.

However, the WKTReader does not (yet) handle the new(ish) POINT Z (…) syntax (or the M syntax, for that matter).

On Mon, May 28, 2012 at 10:20 AM, Justin Deoliveira <jdeolive@anonymised.com> wrote:

Hi Niels,

COrrect, there are not many tests if any that test 3d/2.5d data through the pipeline. Martin did a bunch of stuff recently to start testing this and soon tests should start showing up in GeoServer. We also discussed what support for 2.5d data we get with property datastore.

As far as I know the JTS WKT reader will respect a third coordinate. For instance if i parse POINT(1 2 3) I do get back a Point that has an underlying coordinate that maintains a z value of 3. Not sure about the other geometries but the impression I got from Martin is that its maintained. Writing I believe might be a different story.

Long story short through I believe you can use property datastore as it is today to test 2.5d as long as you are not doing transactions.

-Justin

On Mon, May 28, 2012 at 1:15 AM, Niels Charlier <niels@anonymised.com> wrote:

Hi,

I am trying to write some unit tests in geoserver that use 3d
geometries, and was looking for examples but cannot actually find much
3d geometry testing on the geoserver side.

I tried using property files with WKT, however the WKT format for 3d
geometries doesn’t seem to be supported, for example a 3d point would be
encoded as
Point Z (x y z)
Am I correct to say this is not supported yet? I want to implement this
for property files. Anyone have any experience in how to do something
like that?

Cheers
Niels


Live Security Virtual Conference
Exclusive live event will cover all the ways today’s security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/


Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel


Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.


Live Security Virtual Conference
Exclusive live event will cover all the ways today’s security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/


Geoserver-devel mailing list
Geoserver-devel@anonymised.comsts.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Martin Davis
OpenGeo - http://opengeo.org
Expert service straight from the developers.

Aside: We also have a subclass of WKTReader that has been extended to read in curves as LineStrings. Due to the nature of the superclass with many methods being private this subclass is more of the nature of a fork.

Jody Garnett

On Thursday, 31 May 2012 at 7:40 AM, Martin Davis wrote:

The JTS WKTReader does respect Z ordinates in WKT, and will populate the Z field in the Coordinate objects created. This works for all geometries.

However, the WKTReader does not (yet) handle the new(ish) POINT Z (…) syntax (or the M syntax, for that matter).

On Mon, May 28, 2012 at 10:20 AM, Justin Deoliveira <jdeolive@anonymised.com…1501…> wrote:

Hi Niels,

COrrect, there are not many tests if any that test 3d/2.5d data through the pipeline. Martin did a bunch of stuff recently to start testing this and soon tests should start showing up in GeoServer. We also discussed what support for 2.5d data we get with property datastore.

As far as I know the JTS WKT reader will respect a third coordinate. For instance if i parse POINT(1 2 3) I do get back a Point that has an underlying coordinate that maintains a z value of 3. Not sure about the other geometries but the impression I got from Martin is that its maintained. Writing I believe might be a different story.

Long story short through I believe you can use property datastore as it is today to test 2.5d as long as you are not doing transactions.

-Justin

On Mon, May 28, 2012 at 1:15 AM, Niels Charlier <niels@anonymised.com> wrote:

Hi,

I am trying to write some unit tests in geoserver that use 3d
geometries, and was looking for examples but cannot actually find much
3d geometry testing on the geoserver side.

I tried using property files with WKT, however the WKT format for 3d
geometries doesn’t seem to be supported, for example a 3d point would be
encoded as
Point Z (x y z)
Am I correct to say this is not supported yet? I want to implement this
for property files. Anyone have any experience in how to do something
like that?

Cheers
Niels


Live Security Virtual Conference
Exclusive live event will cover all the ways today’s security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/


Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel


Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.


Live Security Virtual Conference
Exclusive live event will cover all the ways today’s security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/


Geoserver-devel mailing list
Geoserver-devel@anonymised.comsts.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Martin Davis
OpenGeo - http://opengeo.org
Expert service straight from the developers.


Live Security Virtual Conference
Exclusive live event will cover all the ways today’s security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/


GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

I see now what the problem was: the Z coordinate is indeed populated, but it is not outputted by WTKWriter. Which is a problem for WFS.

On 30/05/12 23:40, Martin Davis wrote:

The JTS WKTReader does respect Z ordinates in WKT, and will populate the Z field in the Coordinate objects created. This works for all geometries.

However, the WKTReader does not (yet) handle the new(ish) POINT Z (…) syntax (or the M syntax, for that matter).

On Mon, May 28, 2012 at 10:20 AM, Justin Deoliveira <jdeolive@anonymised.com> wrote:

Hi Niels,

COrrect, there are not many tests if any that test 3d/2.5d data through the pipeline. Martin did a bunch of stuff recently to start testing this and soon tests should start showing up in GeoServer. We also discussed what support for 2.5d data we get with property datastore.

As far as I know the JTS WKT reader will respect a third coordinate. For instance if i parse POINT(1 2 3) I do get back a Point that has an underlying coordinate that maintains a z value of 3. Not sure about the other geometries but the impression I got from Martin is that its maintained. Writing I believe might be a different story.

Long story short through I believe you can use property datastore as it is today to test 2.5d as long as you are not doing transactions.

-Justin

On Mon, May 28, 2012 at 1:15 AM, Niels Charlier <niels@anonymised.com> wrote:

Hi,

I am trying to write some unit tests in geoserver that use 3d
geometries, and was looking for examples but cannot actually find much
3d geometry testing on the geoserver side.

I tried using property files with WKT, however the WKT format for 3d
geometries doesn’t seem to be supported, for example a 3d point would be
encoded as
Point Z (x y z)
Am I correct to say this is not supported yet? I want to implement this
for property files. Anyone have any experience in how to do something
like that?

Cheers
Niels


Live Security Virtual Conference
Exclusive live event will cover all the ways today’s security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/


Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel


Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.


Live Security Virtual Conference
Exclusive live event will cover all the ways today’s security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/


Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Martin Davis
OpenGeo - http://opengeo.org
Expert service straight from the developers.

On Mon, Jun 4, 2012 at 3:16 PM, Niels Charlier <niels@anonymised.com> wrote:

I see now what the problem was: the Z coordinate is indeed populated, but it
is not outputted by WTKWriter. Which is a problem for WFS.

The WKTWriter can write 3d, but you have to tell it so when constructing it:
new WKTWriter(3)

I guess we'll need some way to say that a geometry is 3d in the property
data store.
Have a look at the Hints.COORDINATE_DIMENSION hint and how it's used in
https://jira.codehaus.org/browse/GEOT-4163

Cheers
Andrea

--
Ing. Andrea Aime
GeoSolutions S.A.S.
Tech lead

Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy

phone: +39 0584 962313
fax: +39 0584 962313
mob: +39 339 8844549

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.youtube.com/user/GeoSolutionsIT
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf

The problem is actually not with wtkwriter but with the GML encoder.
It outputs 2 dimensions and I need to get all three. That's a problem for WFS supporting 3 dimensions.

For example, in PointTypeBinding I see the code:

if ("pos".equals(name.getLocalPart())) {
             Point point = (Point) object;

             DirectPosition2D dp = new DirectPosition2D();
             dp.setOrdinate(0, point.getX());
             dp.setOrdinate(1, point.getY());

             return dp;
         }

This should also support 3 dimensions.

Cheers
Niels

On 04/06/12 15:23, Andrea Aime wrote:

On Mon, Jun 4, 2012 at 3:16 PM, Niels Charlier<niels@anonymised.com> wrote:

I see now what the problem was: the Z coordinate is indeed populated, but it
is not outputted by WTKWriter. Which is a problem for WFS.

The WKTWriter can write 3d, but you have to tell it so when constructing it:
new WKTWriter(3)

I guess we'll need some way to say that a geometry is 3d in the property
data store.
Have a look at the Hints.COORDINATE_DIMENSION hint and how it's used in
https://jira.codehaus.org/browse/GEOT-4163

Cheers
Andrea

This should have been fixed recently on trunk.

https://jira.codehaus.org/browse/GEOT-4136

On Mon, Jun 4, 2012 at 9:49 AM, Niels Charlier <niels@anonymised.com> wrote:

The problem is actually not with wtkwriter but with the GML encoder.
It outputs 2 dimensions and I need to get all three. That’s a problem
for WFS supporting 3 dimensions.

For example, in PointTypeBinding I see the code:

if (“pos”.equals(name.getLocalPart())) {
Point point = (Point) object;

DirectPosition2D dp = new DirectPosition2D();
dp.setOrdinate(0, point.getX());
dp.setOrdinate(1, point.getY());

return dp;
}

This should also support 3 dimensions.

Cheers
Niels

On 04/06/12 15:23, Andrea Aime wrote:

On Mon, Jun 4, 2012 at 3:16 PM, Niels Charlier<niels@anonymised.com> wrote:

I see now what the problem was: the Z coordinate is indeed populated, but it
is not outputted by WTKWriter. Which is a problem for WFS.
The WKTWriter can write 3d, but you have to tell it so when constructing it:
new WKTWriter(3)

I guess we’ll need some way to say that a geometry is 3d in the property
data store.
Have a look at the Hints.COORDINATE_DIMENSION hint and how it’s used in
https://jira.codehaus.org/browse/GEOT-4163

Cheers
Andrea


Live Security Virtual Conference
Exclusive live event will cover all the ways today’s security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/


Geoserver-devel mailing list
Geoserver-devel@anonymised.comsts.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel


Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.

Doh!!! Of course, I saw this issue already.
What I am trying to do should actually already work with latest version.
I’ll found out soon…

Cheers
Niels

On 04/06/12 18:32, Justin Deoliveira wrote:

This should have been fixed recently on trunk.

https://jira.codehaus.org/browse/GEOT-4136

On Mon, Jun 4, 2012 at 9:49 AM, Niels Charlier <niels@anonymised.com> wrote:

The problem is actually not with wtkwriter but with the GML encoder.
It outputs 2 dimensions and I need to get all three. That’s a problem
for WFS supporting 3 dimensions.

For example, in PointTypeBinding I see the code:

if (“pos”.equals(name.getLocalPart())) {
Point point = (Point) object;

DirectPosition2D dp = new DirectPosition2D();
dp.setOrdinate(0, point.getX());
dp.setOrdinate(1, point.getY());

return dp;
}

This should also support 3 dimensions.

Cheers
Niels

On 04/06/12 15:23, Andrea Aime wrote:

On Mon, Jun 4, 2012 at 3:16 PM, Niels Charlier<niels@anonymised.com> wrote:

I see now what the problem was: the Z coordinate is indeed populated, but it
is not outputted by WTKWriter. Which is a problem for WFS.
The WKTWriter can write 3d, but you have to tell it so when constructing it:
new WKTWriter(3)

I guess we’ll need some way to say that a geometry is 3d in the property
data store.
Have a look at the Hints.COORDINATE_DIMENSION hint and how it’s used in
https://jira.codehaus.org/browse/GEOT-4163

Cheers
Andrea


Live Security Virtual Conference
Exclusive live event will cover all the ways today’s security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/


Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel


Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.