Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Geometry collection layer type #89

Closed
FilipLeitner opened this issue Aug 14, 2020 · 3 comments · Fixed by #94
Closed

Geometry collection layer type #89

FilipLeitner opened this issue Aug 14, 2020 · 3 comments · Fixed by #94
Labels
enhancement New feature or request

Comments

@FilipLeitner
Copy link
Contributor

In case of editable vector layers (from users' point of view) it might be beneficial to store layers as geometry collection even if the layer only contains single geometry. It would allow features of different geometry to be added in the future.

@jirik jirik added this to the WFS proxy E1 milestone Aug 15, 2020
@jirik jirik added the enhancement New feature or request label Aug 15, 2020
@jirik
Copy link
Member

jirik commented Aug 17, 2020

@jirik
Copy link
Member

jirik commented Aug 17, 2020

Use general GEOMETRY type

@jirik
Copy link
Member

jirik commented Aug 17, 2020

@index-git Some sample requests below. They are for username "test", which appears in URL ".../geoserver/test/ows..." and in XML as xmlns:test="http://test" Also, layername appear in XML.

curl -X POST -u layman:laymanpwd --data-binary @wfs-t-insert-line.xml -H "Content-Type: text/xml" "http://localhost:8600/geoserver/test/ows?service=WFS&request=Transaction"

wfs-t-insert-line.xml

<?xml version="1.0"?>
<wfs:Transaction
   version="2.0.0"
   service="WFS"
   xmlns:test="http://test"
   xmlns:fes="http://www.opengis.net/fes/2.0"
   xmlns:gml="http://www.opengis.net/gml/3.2"
   xmlns:wfs="http://www.opengis.net/wfs/2.0"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://www.opengis.net/wfs/2.0
                       http://schemas.opengis.net/wfs/2.0/wfs.xsd
                       http://www.opengis.net/gml/3.2
                       http://schemas.opengis.net/gml/3.2.1/gml.xsd">
   <wfs:Insert>
       <test:ne_110m_admin_0_countries>
           <test:wkb_geometry>
               <gml:MultiCurve srsName="urn:ogc:def:crs:EPSG::3857" srsDimension="2">
                   <gml:curveMember>
                       <gml:LineString>
                           <gml:posList>3722077.1689 5775850.1007 3751406.9331 5815606.0102 3830548.3984 5781176.5357
                               3866350.4899 5774848.8358 3880796.9478 5743277.797 3897591.3679 5738418.6547
                           </gml:posList>
                       </gml:LineString>
                   </gml:curveMember>
               </gml:MultiCurve>
           </test:wkb_geometry>
       </test:ne_110m_admin_0_countries>
   </wfs:Insert>
</wfs:Transaction>

curl -X POST -u layman:laymanpwd --data-binary @wfs-t-insert-point.xml -H "Content-Type: text/xml" "http://localhost:8600/geoserver/test/ows?service=WFS&request=Transaction"

wfs-t-insert-point.xml

<?xml version="1.0"?>
<wfs:Transaction
   version="2.0.0"
   service="WFS"
   xmlns:test="http://test"
   xmlns:fes="http://www.opengis.net/fes/2.0"
   xmlns:gml="http://www.opengis.net/gml/3.2"
   xmlns:wfs="http://www.opengis.net/wfs/2.0"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://www.opengis.net/wfs/2.0
                       http://schemas.opengis.net/wfs/2.0/wfs.xsd
                       http://www.opengis.net/gml/3.2
                       http://schemas.opengis.net/gml/3.2.1/gml.xsd">
   <wfs:Insert>
       <test:ne_110m_admin_0_countries>
           <test:wkb_geometry>
               <gml:Point srsName="urn:ogc:def:crs:EPSG::3857" srsDimension="2">
                   <gml:pos>1.27108004304E7 2548415.5977</gml:pos>
               </gml:Point>
           </test:wkb_geometry>
       </test:ne_110m_admin_0_countries>
   </wfs:Insert>
</wfs:Transaction>

Expected error output:

<?xml version="1.0" encoding="UTF-8"?><ows:ExceptionReport xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.0.0" xsi:schemaLocation="http://www.opengis.net/ows/1.1 http://localhost:8600/geoserver/schemas/ows/1.1.0/owsAll.xsd">
  <ows:Exception exceptionCode="OperationProcessingFailed" locator="Transaction">
    <ows:ExceptionText>org.geoserver.wfs.WFSTransactionException: Error performing insert: java.lang.String cannot be cast to com.vividsolutions.jts.geom.Geometry
Error performing insert: java.lang.String cannot be cast to com.vividsolutions.jts.geom.Geometry
java.lang.String cannot be cast to com.vividsolutions.jts.geom.Geometry</ows:ExceptionText>
  </ows:Exception>
</ows:ExceptionReport>

Expected OK outout:

<?xml version="1.0" encoding="UTF-8"?><wfs:TransactionResponse xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fes="http://www.opengis.net/fes/2.0" xmlns:wfs="http://www.opengis.net/wfs/2.0" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.0.0" xsi:schemaLocation="http://www.opengis.net/wfs/2.0 http://localhost:8600/geoserver/schemas/wfs/2.0/wfs.xsd"><wfs:TransactionSummary><wfs:totalInserted>1</wfs:totalInserted><wfs:totalUpdated>0</wfs:totalUpdated><wfs:totalReplaced>0</wfs:totalReplaced><wfs:totalDeleted>0</wfs:totalDeleted></wfs:TransactionSummary><wfs:InsertResults><wfs:Feature><fes:ResourceId rid="ne_110m_admin_0_countries.180"/></wfs:Feature></wfs:InsertResults></wfs:TransactionResponse>j

index-git added a commit that referenced this issue Aug 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants