Thanks Andrea&Alexander I got it working, it wasnt issue with
namespaces (i always use ones that i specify in geoserver) but it was
some problem with ndims constraint in pgis table:
by default shp2pgsql creates 3dim coordinates
SELECT AddGeometryColumn('','roads','geom','4326','MULTILINESTRING',3);
which creates constraint:
ALTER TABLE roads ADD CONSTRAINT enforce_dims_geom2 CHECK (ndims(geom2) = 3);
that throws
Caused by: org.geotools.data.DataSourceException: SQL Exception
writing geometry columnERROR: new row for relation "roads" violates
check constraint "enforce_dims_geom"
droping constraint and changing it to
ALTER TABLE roads ADD CONSTRAINT enforce_dims_geom2 CHECK (ndims(geom2) = 2);
successfully inserts the data. For now im happy with that, but what if
I want to insert 3rd dimension? iIf I leave (ndims(geom2) = 3) and add
3d coordinate
<gml:posList>146 -44.3 0 146.2 -44.5 0 146.3 -44.7 0</gml:posList>
i get:
<ows:ExceptionText>
org.geotools.referencing.operation.projection.PointOutsideEnvelopeException:
146.2 outside of (-90.0,90.0) Parsing failed for
LineString: org.geoserver.wfs.WFSException:
org.geotools.referencing.operation.projection.PointOutsideEnvelopeException:
146.2 outside of (-90.0,90.0)
org.geotools.referencing.operation.projection.PointOutsideEnvelopeException:
146.2 outside of (-90.0,90.0) 146.2 outside of (-90.0,90.0)
</ows:ExceptionText>
Obviously thats not the way to insert third dimension, posList accepts
only 2dims, am i right? What would be the right way to insert 3rd
dimension in GML3?
Thank you
On Mon, Jan 12, 2009 at 3:02 PM, Andrea Aime <aaime@anonymised.com> wrote:
Ivan Grcic ha scritto:
Hi all,
i have the same problem here. Its the first time im working with wfs-t
though.
I started with demo wfs-t included in geoserver (1.7.1), that writes
new features to shape files (tasmania cities and roads) Demo is
working fine. Then i shp2pgsql roads and tried to make wfs-t work with
postgis.i get the same result as alexander, new rows in table without
geom data.
im posting my geom in gml3, this is my request
<wfs:Transaction xmlns:wfs="http://www.opengis.net/wfs"
version="1.1.0" service="WFS">
<wfs:Insert>
<feature:roads xmlns:feature="http://test">
Ivan, is this xmlns made up or is it known to GeoServer?
A real schema driven parse is done, so if you make up
namespaces the parser won't work.
If you don't specify the namespace of your feature and
just use the prefix configured in GeoServer it should
work anyways (failing to find a proper xmlns it will
try to do a prefix match with the known prefixes in
the server, as most client cannot really make
up a proper wfs request with the right namespace
references and so on), but if you do, make sure
the xmlns you specify exactly matches the one you
specified in GeoServer for your data store.
Hope this helps
Cheers
Andrea
--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.
--
Ivan Grcic