[Geoserver-devel] Geoserver WFS and PostGis 3D

Hi All,

In the past there have been several discussions about 3D support in geotools, jts and geoserver.
Up untill know there has been done some work (plans) on this but it’s still nailed down to 2D in most of the software components.
Because of that we (CycloMedia) have been using Deegree 2.4 WFS for serving 3D vector data to be able
to visualize this data into geotagged panoramic images. Unfortunatly this functionality seems to broken in Deegree 3.1.

This (and the horror of configuring stores and layers in Deegree) triggered me to have a look and see if we
could manage to get it working in Geoserver.
With some modifications and extensions in Geotools and JTS we managed to get it working for the latest 2.1dev version. (currently WFS only)

I was wondering what the plans/roadmap are for 3D support in Geoserver and how we can contribute to that.

Thanks and best regards,
Sjoerd Brandsma
CycloMedia

Thats very good news indeed.

The app-schema support provides some support for 1D objects, I'm not
sure that 3-D has been yet tested - and certainly 3D geometry
operations wont be.

can you provide some more details of what changes you made, to which
components, to deliver what capability - there will be interest from
the Spatial Information Services Stack project, (contributing the
app-schema support) in this as some of the funding comes from the
earth resources sector, and they have a lot of 3D data.

Regards
Rob Atkinson

On Wed, Jan 19, 2011 at 2:12 AM, Sjoerd Brandsma <sbrandsma@anonymised.com> wrote:

Hi All,

In the past there have been several discussions about 3D support in
geotools, jts and geoserver.
Up untill know there has been done some work (plans) on this but it's still
nailed down to 2D in most of the software components.
Because of that we (CycloMedia) have been using Deegree 2.4 WFS for serving
3D vector data to be able
to visualize this data into geotagged panoramic images. Unfortunatly this
functionality seems to broken in Deegree 3.1.

This (and the horror of configuring stores and layers in Deegree) triggered
me to have a look and see if we
could manage to get it working in Geoserver.
With some modifications and extensions in Geotools and JTS we managed to get
it working for the latest 2.1dev version. (currently WFS only)

I was wondering what the plans/roadmap are for 3D support in Geoserver and
how we can contribute to that.

Thanks and best regards,
Sjoerd Brandsma
CycloMedia

------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand
malware threats, the impact they can have on your business, and how you
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Hi,

Minor steps have been made so far. Only two days of initial effort has been put in so don’t expect much :slight_smile:

Changes made:

Geotools

  • Modification in gt-jdbc-postgis to be able to get postgis data:
    use ST_AsEWKB instead of ST_AsBinary because ST_AsBinary ony returns X,Y
    removed force_2d from query

  • Modification in gt-referencing:
    added DirectPosition3D class

  • couple of gml/geometry modifications in gt-main

  • couple of modifications in gt-xsd-gml3

  • couple of modifications in gt-xsd-api

JTS

  • added getCoordDimensions function to geometry and implementors
  • modified WKTWriter to be able to write 3d data

Geoserver

  • temporary modification for WGS84 bounding box calculation when adding 3D vector layers

I’ll probably forget some changes that will appear when I’ll do proper source check.
Above modifications make it possible to get 3D GML data from a postgis database using Geoserver.

Currently we only tested this with POINT in EPSG:7415 (Amersfoort RD new + NAP).
We will also test LINESTRING and POLYGON pretty soon.

Best regards,
Sjoerd

On Tue, Jan 18, 2011 at 11:19 PM, Rob Atkinson <robatkinson101@anonymised.com> wrote:

Thats very good news indeed.

The app-schema support provides some support for 1D objects, I’m not
sure that 3-D has been yet tested - and certainly 3D geometry
operations wont be.

can you provide some more details of what changes you made, to which
components, to deliver what capability - there will be interest from
the Spatial Information Services Stack project, (contributing the
app-schema support) in this as some of the funding comes from the
earth resources sector, and they have a lot of 3D data.

Regards
Rob Atkinson

On Wed, Jan 19, 2011 at 2:12 AM, Sjoerd Brandsma <sbrandsma@anonymised.com> wrote:

Hi All,

In the past there have been several discussions about 3D support in
geotools, jts and geoserver.
Up untill know there has been done some work (plans) on this but it’s still
nailed down to 2D in most of the software components.
Because of that we (CycloMedia) have been using Deegree 2.4 WFS for serving
3D vector data to be able
to visualize this data into geotagged panoramic images. Unfortunatly this
functionality seems to broken in Deegree 3.1.

This (and the horror of configuring stores and layers in Deegree) triggered
me to have a look and see if we
could manage to get it working in Geoserver.
With some modifications and extensions in Geotools and JTS we managed to get
it working for the latest 2.1dev version. (currently WFS only)

I was wondering what the plans/roadmap are for 3D support in Geoserver and
how we can contribute to that.

Thanks and best regards,
Sjoerd Brandsma
CycloMedia


Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand
malware threats, the impact they can have on your business, and how you
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl


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

On Tue, Jan 18, 2011 at 11:55 PM, Sjoerd Brandsma <sbrandsma@anonymised.com> wrote:

Hi,

Minor steps have been made so far. Only two days of initial effort has been
put in so don't expect much :slight_smile:

Changes made:

Geotools

- Modification in gt-jdbc-postgis to be able to get postgis data:
use ST_AsEWKB instead of ST_AsBinary because ST_AsBinary ony returns X,Y
removed force_2d from query

Hmm... that might end up breaking WMS. There is a hint to return flat features,
the store should be modified to respect it.

- Modification in gt-referencing:
added DirectPosition3D class

- couple of gml/geometry modifications in gt-main
- couple of modifications in gt-xsd-gml3
- couple of modifications in gt-xsd-api

Makes sense.

JTS

- added getCoordDimensions function to geometry and implementors
- modified WKTWriter to be able to write 3d data

Are those both strictly necessary? Patching JTS is problematic, we
only used stock
releases so far.
It would be nicer, imho, to keep the knowledge that a certain geometry is 3d
as part of the GeometryDescriptor, possibly as an entry in that class metadata
map.

Geoserver
- temporary modification for WGS84 bounding box calculation when adding 3D
vector layers

This should be done only in case of 3d data as well.

I'll probably forget some changes that will appear when I'll do proper
source check.
Above modifications make it possible to get 3D GML data from a postgis
database using Geoserver.

Currently we only tested this with POINT in EPSG:7415 (Amersfoort RD new +
NAP).
We will also test LINESTRING and POLYGON pretty soon.

Ah ok, so by 3D you really mean planar geometry with 3d coordinates, not solids,
right?

Cheers
Andrea

--
Ing. Andrea Aime
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy

phone: +39 0584962313
fax: +39 0584962313

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

-----------------------------------------------------

On Tue, Jan 18, 2011 at 4:12 PM, Sjoerd Brandsma <sbrandsma@anonymised.com> wrote:

Hi All,

In the past there have been several discussions about 3D support in
geotools, jts and geoserver.
Up untill know there has been done some work (plans) on this but it's still
nailed down to 2D in most of the software components.
Because of that we (CycloMedia) have been using Deegree 2.4 WFS for serving
3D vector data to be able
to visualize this data into geotagged panoramic images. Unfortunatly this
functionality seems to broken in Deegree 3.1.

This (and the horror of configuring stores and layers in Deegree) triggered
me to have a look and see if we
could manage to get it working in Geoserver.
With some modifications and extensions in Geotools and JTS we managed to get
it working for the latest 2.1dev version. (currently WFS only)

I was wondering what the plans/roadmap are for 3D support in Geoserver and
how we can contribute to that.

I don't know of any firm plan with deadlines and the like, but more of
a general
interest in the issue.
The way to go is to discuss with the community the changes, possibly
make an improvement proposal (required in case the changes are extensive/core),
and provide a patch for review

Thanks for reaching out and participating with the dev community :slight_smile:

Cheers
Andrea

--
Ing. Andrea Aime
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy

phone: +39 0584962313
fax: +39 0584962313

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

-----------------------------------------------------

Hi,

Thanks for the feedback! Much appreciated.

Currently, it does break WMS. Thanks for the hint on how to solve this.
I’ll look into the JTS issue and see how this can be solved in a different way.

And yes, at the moment we’re only using the flat geometries with 3D coodinates.
With WFS and SLD this is already quite powerfull to visualize vector data in our
360 deg. panoramic images. Next step would be create, modify and visualize vector data
(using panoramic images) with WFS-T. Ultimatley we will plan to use solid models as well.
In all cases we will use client side rendering of the vector data.

I ran into this:
http://docs.codehaus.org/display/GEOTOOLS/Partial+3D+data+support
Is it still actual?

Is there any architecture documentation about geotools/geoserver?

Thanks,
Sjoerd Brandsma
CycloMedia

On Wed, Jan 19, 2011 at 2:39 PM, Andrea Aime <andrea.aime@anonymised.com> wrote:

On Tue, Jan 18, 2011 at 11:55 PM, Sjoerd Brandsma <sbrandsma@anonymised.com> wrote:

Hi,

Minor steps have been made so far. Only two days of initial effort has been
put in so don’t expect much :slight_smile:

Changes made:

Geotools

  • Modification in gt-jdbc-postgis to be able to get postgis data:
    use ST_AsEWKB instead of ST_AsBinary because ST_AsBinary ony returns X,Y
    removed force_2d from query

Hmm… that might end up breaking WMS. There is a hint to return flat features,
the store should be modified to respect it.

  • Modification in gt-referencing:
    added DirectPosition3D class

  • couple of gml/geometry modifications in gt-main

  • couple of modifications in gt-xsd-gml3

  • couple of modifications in gt-xsd-api

Makes sense.

JTS

  • added getCoordDimensions function to geometry and implementors
  • modified WKTWriter to be able to write 3d data

Are those both strictly necessary? Patching JTS is problematic, we
only used stock
releases so far.
It would be nicer, imho, to keep the knowledge that a certain geometry is 3d
as part of the GeometryDescriptor, possibly as an entry in that class metadata
map.

Geoserver

  • temporary modification for WGS84 bounding box calculation when adding 3D
    vector layers

This should be done only in case of 3d data as well.

I’ll probably forget some changes that will appear when I’ll do proper
source check.
Above modifications make it possible to get 3D GML data from a postgis
database using Geoserver.

Currently we only tested this with POINT in EPSG:7415 (Amersfoort RD new +
NAP).
We will also test LINESTRING and POLYGON pretty soon.

Ah ok, so by 3D you really mean planar geometry with 3d coordinates, not solids,
right?

Cheers
Andrea


Ing. Andrea Aime
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy

phone: +39 0584962313
fax: +39 0584962313

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


Hi,

Ok. I'll start a new thread and discuss the proposed changes for the
'planar geometry with 3d coordinates' support in geoserver.

Thanks for the support.

Best regards,
Sjoerd Brandsma
CycloMedia

On Wed, Jan 19, 2011 at 2:41 PM, Andrea Aime
<andrea.aime@anonymised.com> wrote:

On Tue, Jan 18, 2011 at 4:12 PM, Sjoerd Brandsma <sbrandsma@anonymised.com> wrote:

Hi All,

In the past there have been several discussions about 3D support in
geotools, jts and geoserver.
Up untill know there has been done some work (plans) on this but it's still
nailed down to 2D in most of the software components.
Because of that we (CycloMedia) have been using Deegree 2.4 WFS for serving
3D vector data to be able
to visualize this data into geotagged panoramic images. Unfortunatly this
functionality seems to broken in Deegree 3.1.

This (and the horror of configuring stores and layers in Deegree) triggered
me to have a look and see if we
could manage to get it working in Geoserver.
With some modifications and extensions in Geotools and JTS we managed to get
it working for the latest 2.1dev version. (currently WFS only)

I was wondering what the plans/roadmap are for 3D support in Geoserver and
how we can contribute to that.

I don't know of any firm plan with deadlines and the like, but more of
a general
interest in the issue.
The way to go is to discuss with the community the changes, possibly
make an improvement proposal (required in case the changes are extensive/core),
and provide a patch for review

Thanks for reaching out and participating with the dev community :slight_smile:

Cheers
Andrea

--
Ing. Andrea Aime
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy

phone: +39 0584962313
fax: +39 0584962313

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

-----------------------------------------------------

On Wed, Jan 19, 2011 at 8:18 PM, Sjoerd Brandsma <sbrandsma@anonymised.com> wrote:

Hi,

Thanks for the feedback! Much appreciated.

Currently, it does break WMS. Thanks for the hint on how to solve this.
I'll look into the JTS issue and see how this can be solved in a different
way.

And yes, at the moment we're only using the flat geometries with 3D
coodinates.
With WFS and SLD this is already quite powerfull to visualize vector data in
our
360 deg. panoramic images. Next step would be create, modify and visualize
vector data
(using panoramic images) with WFS-T. Ultimatley we will plan to use solid
models as well.
In all cases we will use client side rendering of the vector data.

I ran into this:
http://docs.codehaus.org/display/GEOTOOLS/Partial+3D+data+support
Is it still actual?

That's work I did in the past. Unfortunately the upgrade from old to current
jdbc data stores broke the data reading part, but the rest of the changes
are still in place.
That allowed to have 2d geometries with 3d coordinates output in KML
and, I believe, in GML2

Is there any architecture documentation about geotools/geoserver?

Nope, we tried to make some in the past but the reality is we
don't have time to maintain it. The source code is your guide (coupled
with the occasional step by step debugging session and the modern
IDE code navigation tools).

All we have is here (a bit outdated, but probably better than nothing):
http://geoserver.org/display/GEOSDOC/4+Programmers+Guide
and here:
http://docs.geoserver.org/stable/en/developer/

If you have specific questions just ask

Cheers
Andrea

--
Ing. Andrea Aime
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy

phone: +39 0584962313
fax: +39 0584962313

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

-----------------------------------------------------

- added getCoordDimensions function to geometry and implementors
- modified WKTWriter to be able to write 3d data

Are those both strictly necessary? Patching JTS is problematic, we
only used stock
releases so far.
It would be nicer, imho, to keep the knowledge that a certain geometry is 3d
as part of the GeometryDescriptor, possibly as an entry in that class metadata
map.

Going to echo Andrea here; you will find we have extended WKTReader already in GeoTools (in order to parse WKT Curves); if you could take the same approach for WKTWriter it would be helpful.

Not sure about getCoordinateDimensions? You will find CoordianteSequence already has some of that handled (in order to allow for x,y,z,m data from oracle).

Jody

Hi,

Thanks for the support so far.

I've cleaned up the modifications and removed all modifications to
JTS. It appeared they weren't really necessary.
I've added Hints to PostGISDialect.java to be able to switch between
2D and 3D. This could look something like this:

        int dims = 2; // default

        if (gatt.getUserData().get(Hints.FEATURE_2D) != null) {
          dims = 2;
        }
        else if(gatt.getUserData().get(Hints.COORDINATE_DIMENSION) != null) {
            dims = ((Number)
gatt.getUserData().get(Hints.COORDINATE_DIMENSION)).intValue();
        }

---> Question: Were to set those hints so it will be picked up by
PostGISDialect.

GML 3.1 seems to work ok now. GML 3.2 gives some problems because the
LocationPropertyType.getProperty in GetPropertyExecuter
never seems to return a child:

child = complex.getProperty(parent, name);
parent = Point
name = AbstractGeometry, LocationString, ... (not sure which one
should fit here)

Any idea on this?

Thanks,

Sjoerd
On Thu, Jan 20, 2011 at 3:13 PM, Jody Garnett <jody.garnett@anonymised.com> wrote:

- added getCoordDimensions function to geometry and implementors
- modified WKTWriter to be able to write 3d data

Are those both strictly necessary? Patching JTS is problematic, we
only used stock
releases so far.
It would be nicer, imho, to keep the knowledge that a certain geometry is 3d
as part of the GeometryDescriptor, possibly as an entry in that class metadata
map.

Going to echo Andrea here; you will find we have extended WKTReader already in GeoTools (in order to parse WKT Curves); if you could take the same approach for WKTWriter it would be helpful.

Not sure about getCoordinateDimensions? You will find CoordianteSequence already has some of that handled (in order to allow for x,y,z,m data from oracle).

Jody