[Geoserver-users] 3D shapes in GeoServer

Hi,
I have some shp-files which after published through Geoserver seem to be 3D. GML3 Getfeature response shows attribute: srsDimension="3" and gml:posList has z-coordinates (which are all 0.0.). This will break OpenLayers or I guess it does. I noticed that OL 2.13RC is patched against this?

https://github.com/openlayers/openlayers/pull/530

So my question is: Is there any possibilities in Geoserver for preventing 3D published as 3D, can I force it to 2D?

This will do:

<gml:MultiSurface srsDimension="2" srsName="http://www.opengis.net/gml/srs/epsg.xml#3067&quot;&gt;
<gml:surfaceMember>
<gml:Polygon srsDimension="2">
<gml:exterior>
<gml:LinearRing srsDimension="2">
<gml:posList>285383.3058645713 6698894.352306922 285425.5159348707 6699017.2593868375 285342.7181416074

This won't:

<gml:MultiSurface srsDimension="3" srsName="http://www.opengis.net/gml/srs/epsg.xml#3067&quot;&gt;
<gml:surfaceMember>
<gml:Polygon srsDimension="3">
<gml:exterior>
<gml:LinearRing srsDimension="3">
<gml:posList>288660.33709455427 6704207.924076746 0.0 288681.0786007411 6704265.434737128 0.0

- mika -

On Tue, May 21, 2013 at 10:03 AM, <mika@anonymised.com> wrote:

I noticed that OL 2.13RC is patched
against this?

https://github.com/openlayers/openlayers/pull/530

So my question is: Is there any possibilities in Geoserver for
preventing 3D published as 3D, can I force it to 2D?

I believe there is no config allowing you to get that.
The situation vs 2D/3D in GeoServer is evolving, right now WFS tries
to preserve the 3rd dimension if present, WMS of course strips it, but
the same stripping code is not available in the WFS case.

To get what you want I guess one would have to add a flag in the GUI
to force data in 2D mode, and then have code in GeoServer to strip
the 3rd dimension while reading the data.

In your case a directly applicable approach is to ogr2ogr the files
forcing them to 2d:
http://www.gdal.org/ogr2ogr.html

Cheers
Andrea

--

GeoServer training in Milan, 6th & 7th June 2013! Visit
http://geoserver.geo-solutions.it for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

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

Ok,
thanks for your answer Andrea. Have to adjust our shp-production.

- mika -

Andrea Aime kirjoitti 2013-05-21 11:45:

On Tue, May 21, 2013 at 10:03 AM, <mika@anonymised.com> wrote:

I noticed that OL 2.13RC is patched
against this?

https://github.com/openlayers/openlayers/pull/530 [1]

So my question is: Is there any possibilities in Geoserver for
preventing 3D published as 3D, can I force it to 2D?

I believe there is no config allowing you to get that.
The situation vs 2D/3D in GeoServer is evolving, right now WFS tries
to preserve the 3rd dimension if present, WMS of course strips it, but
the same stripping code is not available in the WFS case.

To get what you want I guess one would have to add a flag in the GUI
to force data in 2D mode, and then have code in GeoServer to strip
the 3rd dimension while reading the data.

In your case a directly applicable approach is to ogr2ogr the files
forcing them to 2d:
http://www.gdal.org/ogr2ogr.html [2]

Cheers
Andrea
--

==
GeoServer training in Milan, 6th & 7th June 2013!
Visit http://geoserver.geo-solutions.it [3] for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it [4]
http://twitter.com/geosolutions_it [5]

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

Links:
------
[1] https://github.com/openlayers/openlayers/pull/530
[2] http://www.gdal.org/ogr2ogr.html
[3] http://geoserver.geo-solutions.it/
[4] http://www.geo-solutions.it
[5] http://twitter.com/geosolutions_it