[Geoserver-devel] WFS-T trunk, insert, and reprojection

Hi,
today I hit a strange behaviour... the following insert statement:

<wfs:Insert>
     <topp:archsites fid="archsites.2">
       <topp:cat>2</topp:cat>
       <topp:str1>Alien crash site</topp:str1>
       <topp:the_geom>
         <gml:Point srsName="http://www.opengis.net/gml/srs/epsg.xml#26713&quot;&gt;
           <gml:coordinates decimal="." cs="," ts=" ">604000,4930000</gml:coordinates>
         </gml:Point>
       </topp:the_geom>
     </topp:archsites>
   </wfs:Insert>

kept on inserting feature after reprojecting the coordinates
to 4326... it took me quite a bit to understand what was going
on, but it seems that:
* the feature parser in WFS insert request is not attaching
   CRS information to geometry attributes
   parsed feature types do not have CRS inforamtion (it seems
   it's not using the datastore provided feature types)
* the insert engine, not finding a CRS, is assuming 4326, and
   thus reprojects my geometries.

A quick fix would be to disallow reprojection in the insertion
engine if the feature type does not have CRS information,
and that's what I did as a quick fix on my local copy,
but I guess it would break the WFS 1.1 cite test, ain't it?

The real fix would be to have a complete schema attached
to my features, but I don't know where to put my hands to
handle that.

Cheers
Andrea

Andrea Aime wrote:

kept on inserting feature after reprojecting the coordinates
to 4326... it took me quite a bit to understand what was going
on, but it seems that:
* the feature parser in WFS insert request is not attaching
   CRS information to geometry attributes
   parsed feature types do not have CRS inforamtion (it seems
   it's not using the datastore provided feature types)
* the insert engine, not finding a CRS, is assuming 4326, and
   thus reprojects my geometries.
  

I think it should assume the CRS associated with the FeatureType should it not?

The real fix would be to have a complete schema attached
to my features, but I don't know where to put my hands to
handle that.

I think you need justin's magic parser :frowning: And I am not sure he hooked up things for GML2 yet?
Jody

Andrea Aime wrote:

Hi,
today I hit a strange behaviour... the following insert statement:

<wfs:Insert>
     <topp:archsites fid="archsites.2">
       <topp:cat>2</topp:cat>
       <topp:str1>Alien crash site</topp:str1>
       <topp:the_geom>
         <gml:Point srsName="http://www.opengis.net/gml/srs/epsg.xml#26713&quot;&gt;
           <gml:coordinates decimal="." cs="," ts="
">604000,4930000</gml:coordinates>
         </gml:Point>
       </topp:the_geom>
     </topp:archsites>
   </wfs:Insert>

kept on inserting feature after reprojecting the coordinates
to 4326... it took me quite a bit to understand what was going
on, but it seems that:
* the feature parser in WFS insert request is not attaching
   CRS information to geometry attributes
   parsed feature types do not have CRS inforamtion (it seems
   it's not using the datastore provided feature types)

Hmm, are you using the 1.0 or 1.1 parser. I am certain that the crs gets
set on parsed geometries in the "userData" attribute.

* the insert engine, not finding a CRS, is assuming 4326, and
   thus reprojects my geometries.

Hmm, i guess it falls back on getDefaultGeometry() which will not be the
crs specified on the point. Yes this is a problem.

A quick fix would be to disallow reprojection in the insertion
engine if the feature type does not have CRS information,
and that's what I did as a quick fix on my local copy,
but I guess it would break the WFS 1.1 cite test, ain't it?

No because the 1.1 tests always specify geometries in 4326 anyways. I
think the real problem is that there is no really good way to attach a
crs to a feature so that it can override what is specified in the type.

The real fix would be to have a complete schema attached
to my features, but I don't know where to put my hands to
handle that.

Hmmm, i thought i changed the bidnings to do this. To actually use the
feature types from geoserver instead of trying to parse manually the
application schema. Perhaps I only did it for gml3? I will check into this.

Cheers
Andrea

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

!DSPAM:1004,45f5a22d195412207481331!

--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org

Justin Deoliveira ha scritto:

Andrea Aime wrote:

Hi,
today I hit a strange behaviour... the following insert statement:

<wfs:Insert>
     <topp:archsites fid="archsites.2">
       <topp:cat>2</topp:cat>
       <topp:str1>Alien crash site</topp:str1>
       <topp:the_geom>
         <gml:Point srsName="http://www.opengis.net/gml/srs/epsg.xml#26713&quot;&gt;
           <gml:coordinates decimal="." cs="," ts=" ">604000,4930000</gml:coordinates>
         </gml:Point>
       </topp:the_geom>
     </topp:archsites>
   </wfs:Insert>

kept on inserting feature after reprojecting the coordinates
to 4326... it took me quite a bit to understand what was going
on, but it seems that:
* the feature parser in WFS insert request is not attaching
   CRS information to geometry attributes
   parsed feature types do not have CRS inforamtion (it seems
   it's not using the datastore provided feature types)

Hmm, are you using the 1.0 or 1.1 parser.

1.0
And the code is looking for the default geometry, not the actual
geometries, to set a target crs.

Cheers
Andrea