Hi!
I am trying to create a GeoServer-Feature (Simple Feature) with a
MultiSurface geometry. The data is stored in PostGIS. I would like to access
this feature either with WFS GetFeature or in the Layer Preview. But I'm
having problems: if I enter a MultiSurface in a way it is accepted by
PostGIS, GeoServer cannot show it properly. So I am wondering: does
GeoServer support MultiSurface? If yes: how do I need to create the
MultiSurface in PostGIS for it to work in GeoServer?
Here is what I did:
1. In PostGIS, I created a table with a MULTISURFACE:
CREATE TABLE ps3 ( ID int4 primary key, regionname varchar(80) );
SELECT AddGeometryColumn('', 'ps3','geometry',-1,'MULTISURFACE',2);
2. I entered data:
INSERT INTO ps3 (id, regionname,geometry)
VALUES (1,
'myLocation',
ST_GeomFromText('MULTISURFACE(CURVEPOLYGON(CIRCULARSTRING(0 0,4 0,4
4,0 4,0 0),(1 1,3 3,3 1,1 1)))',-1));
(I found the MultiSurface data in:
http://www.fossgis.de/konferenz/2010/attachments/116_PostGIS-einfuehrung_fossgis2010-holl.pdf
http://www.fossgis.de/konferenz/2010/attachments/116_PostGIS-einfuehrung_fossgis2010-holl.pdf
)
3. I added the datastore to GeoServer & published it (Simple Feature). When
I wanted to access my new feature "ps3" via WFS-GetFeature, I got the
following error:
----------------------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<ows:ExceptionReport version="1.0.0"
xsi:schemaLocation="http://www.opengis.net/ows
http://localhost:19664/geoserver/schemas/ows/1.0.0/owsExceptionReport.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ows="http://www.opengis.net/ows">
<ows:Exception exceptionCode="NoApplicableCode">
<ows:ExceptionText>java.lang.RuntimeException:
org.geotools.data.DataSourceException: An exception occurred while parsing
WKB data
org.geotools.data.DataSourceException: An exception occurred while parsing
WKB data
An exception occurred while parsing WKB data
Unknown WKB type 15</ows:ExceptionText>
</ows:Exception>
</ows:ExceptionReport>
-----------------------------------------------------------------------------------------
I also was not able to view the feature via Layer Preview, I got the same
error. Then, I changed the GML-type from gml:GeometryPropertyType to
gml:MultiSurfaceType (in a custom-schema), but this didn't help either.
4. Then, I tried to enter the data in a different way into the
PostGIS-Database:
INSERT INTO ps3 (id, regionname,geometry)
VALUES (1,
'myLocation',
ST_GeomFromText('MULTISURFACE(CURVEPOLYGON(CIRCULARSTRING(0 0, 4 0,
4 4, 0 4, 0 0),(1 1, 3 3, 3 1, 1 1)),((10 10, 14 12, 11 10, 10 10),(11 11,
11.5 11, 11 11.5, 11 11)))',-1));
Same result as before
5. I thought, maybe if I wrapped the MultiSurface around a Polygon it might
work (admittedly, a very wild guess), but this time, PostGIS said that the
geometry was invalid:
insert into ps3 (id, regionname, geometry)
values
(
1,
'myLocation',
ST_GeomFromText('MULTISURFACE(POLYGON((10 10, 10 20, 20 20, 20 15, 10
10)))', -1)
);
Then I noticed that I had forgot about the "Publishing"-Tab in the
Layer-configuration. Previously, I only entered data in the "Data"-Tab. When
I did enter some data in the "Publishing" (e.g. Standard Stil: "Polygon",
selected style "giant_polygon" ), there were no more errors when I called
GetFeature, but the result was empty. Not much better, but maybe a step into
the right direction?
Anybody any idea, why it didn't work? When searching for GeoServer and
MultiSurface, I got the impression that GeoServer does support MultiSurface.
Maybe I defined it the wrong way? I didn't find much examples as to how
create a MultiSurface on PostGIS...
I have to admit that I am new to GeoServer and don't know very much about
geometries... I'm more of a software developer than a GIS-person. So I don't
know much (yet) about MultiSurface and what it can hold. Or what definition
GeoServer needs to work with a MultiSurface. Maybe (hopefully!) I just
defined it the wrong way?
Thanks in advance for your help!
Kind Regards
Barbara
--
View this message in context: http://old.nabble.com/MultiSurface-in-PostGIS-and-GeoServer-tp28765793p28765793.html
Sent from the GeoServer - User mailing list archive at Nabble.com.