I'm trying to download .csv file using GetFeature request (request below).
Two attributes are specified in propertyName option, but I'm still getting
two more columns (FID and unitID) in the .csv file. Is there some way to get
rid of them?
http://<%= GeoServer %>:<%= GeoServerPort
%>/geoserver/IF/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=<%=
Layer %>&bbox=" + ext +
"&propertyName=name,value&outputFormat=csv&viewparams=<%= ViewParams %>
Thanks!
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/wfs-gerefature-propertyName-problem-tp5055307.html
Sent from the GeoServer - User mailing list archive at Nabble.com.
I tested against a public available GeoServer instance (which is version 2.3.1) from OpenGeo with the following URL
http://demo.opengeo.org/geoserver/topp/wfs?outputFormat=csv&propertyName=STATE
and POST :
<wfs:GetFeature service=“WFS” version=“1.0.0”
xmlns:topp=“http://www.openplans.org/topp”
xmlns:wfs=“http://www.opengis.net/wfs”
xmlns:ogc=“http://www.opengis.net/ogc”
xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance”
xsi:schemaLocation=“http://www.opengis.net/wfs
http://schemas.opengis.net/wfs/1.1.0/wfs.xsd”>
<wfs:Query typeName=“topp:tasmania_state_boundaries” >
ogc:Filter
<ogc:FeatureId fid=“tasmania_state_boundaries.1”/>
</ogc:Filter>
</wfs:Query>
</wfs:GetFeature>
and can confirm that more properties than the requested are in the resulting csv response. Seems to me that the propertyName property doesn’t work for CSV ouputFormat correctly (maybe unused in this case). Could you raise a bug report in JIRA?
Thanks a lot
···
2013/5/23 HerrFlick <tomas.mattern@anonymised.com>
I’m trying to download .csv file using GetFeature request (request below).
Two attributes are specified in propertyName option, but I’m still getting
two more columns (FID and unitID) in the .csv file. Is there some way to get
rid of them?
http://<%= GeoServer %>:<%= GeoServerPort
%>/geoserver/IF/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=<%=
Layer %>&bbox=" + ext +
"&propertyName=name,value&outputFormat=csv&viewparams=<%= ViewParams %>
Thanks!
–
View this message in context: http://osgeo-org.1560.x6.nabble.com/wfs-gerefature-propertyName-problem-tp5055307.html
Sent from the GeoServer - User mailing list archive at Nabble.com.
Try New Relic Now & We’ll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
Geoserver-users mailing list
Geoserver-users@anonymised.comsts.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users
On Fri, May 24, 2013 at 9:53 AM, Frank Gasdorf
<fgdrf@anonymised.com>wrote:
I tested against a public available GeoServer instance (which is version
2.3.1) from OpenGeo with the following URL
http://demo.opengeo.org/geoserver/topp/wfs?outputFormat=csv&propertyName=STATE
and POST :
<wfs:GetFeature service="WFS" version="1.0.0"
xmlns:topp="http://www.openplans.org/topp"
xmlns:wfs="http://www.opengis.net/wfs"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/wfs
http://schemas.opengis.net/wfs/1.1.0/wfs.xsd">
<wfs:Query typeName="topp:tasmania_state_boundaries" >
<ogc:Filter>
<ogc:FeatureId fid="tasmania_state_boundaries.1"/>
</ogc:Filter>
</wfs:Query>
</wfs:GetFeature>
and can confirm that more properties than the requested are in the
resulting csv response. Seems to me that the propertyName property doesn't
work for CSV ouputFormat correctly (maybe unused in this case). Could you
raise a bug report in JIRA?
Please wait a second. Can you confirm that the extra properties returned
have minOccurs = 1 in the
DescribeFeatureType output?
If they do, it's working as required, mandatory properties in the schema
cannot be stripped out of
the output, it's by WFS spec.
GeoServer reflects the mandatory properties from the database structure
normally, so a way to
make them optional is to mark the columns as nullable.
We presently don't have a way to configure it otherwise from the GUI, but
if memory serves me
right this can be done by writing some schemas by hand:
http://docs.geoserver.org/stable/en/user/services/wfs/schemamapping.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
-------------------------------------------------------
Andrea, you are right, the used feature type has all minOccurs values set to “1” whereas nillable is set to “true”. Later confuses me a bit because mandatory properties which can be null? Or what does it mean if the property nillable is set tu true?
Used request : http://demo.opengeo.org/geoserver/topp/wfs?request=DescribeFeatureType&typeName=topp:tasmania_state_boundaries
···
2013/5/24 Andrea Aime <andrea.aime@anonymised.com>
On Fri, May 24, 2013 at 9:53 AM, Frank Gasdorf <fgdrf@anonymised.com> wrote:
I tested against a public available GeoServer instance (which is version 2.3.1) from OpenGeo with the following URL
http://demo.opengeo.org/geoserver/topp/wfs?outputFormat=csv&propertyName=STATE
and POST :
<wfs:GetFeature service=“WFS” version=“1.0.0”
xmlns:topp=“http://www.openplans.org/topp”
xmlns:wfs=“http://www.opengis.net/wfs”
xmlns:ogc=“http://www.opengis.net/ogc”
xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance”
xsi:schemaLocation=“http://www.opengis.net/wfs
http://schemas.opengis.net/wfs/1.1.0/wfs.xsd”>
<wfs:Query typeName=“topp:tasmania_state_boundaries” >
ogc:Filter
<ogc:FeatureId fid=“tasmania_state_boundaries.1”/>
</ogc:Filter>
</wfs:Query>
</wfs:GetFeature>
and can confirm that more properties than the requested are in the resulting csv response. Seems to me that the propertyName property doesn’t work for CSV ouputFormat correctly (maybe unused in this case). Could you raise a bug report in JIRA?
Please wait a second. Can you confirm that the extra properties returned have minOccurs = 1 in the
DescribeFeatureType output?
If they do, it’s working as required, mandatory properties in the schema cannot be stripped out of
the output, it’s by WFS spec.
GeoServer reflects the mandatory properties from the database structure normally, so a way to
make them optional is to mark the columns as nullable.
We presently don’t have a way to configure it otherwise from the GUI, but if memory serves me
right this can be done by writing some schemas by hand:
http://docs.geoserver.org/stable/en/user/services/wfs/schemamapping.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
On Fri, May 24, 2013 at 10:19 AM, Frank Gasdorf <fgdrf@anonymised.com
wrote:
Andrea, you are right, the used feature type has all minOccurs values set
to "1" whereas nillable is set to "true". Later confuses me a bit because
mandatory properties which can be null? Or what does it mean if the
property nillable is set tu true?
Used request :
http://demo.opengeo.org/geoserver/topp/wfs?request=DescribeFeatureType&typeName=topp:tasmania_state_boundaries
No no, it means that all properties are optional
I had another look at your request, and it's ill formed: you cannot do a
POST request but do property selection in the url,
mixing the two styles for output format works just by accident.
This one if properly setup, and works as expected:
http://demo.opengeo.org/geoserver/topp/wfs?request=GetFeature&version=1.1.0&service=wfs&typeName=topp:tasmania_state_boundaries&propertyName=STATE&outputFormat=csv
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
-------------------------------------------------------
Thanks! I guess your hint about minOccurs should help to solve the problem. I had a second look at the DescribeFeatureType output and all values set to “0” (and maxOccurs is set to “1”) - sorry for this confusion and the clarification for POST request format itself.
···
2013/5/24 Andrea Aime <andrea.aime@anonymised.com107…>
On Fri, May 24, 2013 at 10:19 AM, Frank Gasdorf <fgdrf@anonymised.com> wrote:
Andrea, you are right, the used feature type has all minOccurs values set to “1” whereas nillable is set to “true”. Later confuses me a bit because mandatory properties which can be null? Or what does it mean if the property nillable is set tu true?
Used request : http://demo.opengeo.org/geoserver/topp/wfs?request=DescribeFeatureType&typeName=topp:tasmania_state_boundaries
No no, it means that all properties are optional
I had another look at your request, and it’s ill formed: you cannot do a POST request but do property selection in the url,
mixing the two styles for output format works just by accident.
This one if properly setup, and works as expected:
http://demo.opengeo.org/geoserver/topp/wfs?request=GetFeature&version=1.1.0&service=wfs&typeName=topp:tasmania_state_boundaries&propertyName=STATE&outputFormat=csv
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
BTW, I was wondering about the request URL, first I tried without service=WFS and got an exception that doesn’t say anything about the missing required parameter (http://demo.opengeo.org/geoserver/topp/wfs?request=GetFeature&version=1.0.0&outputFormat=csv&propertyName=STATE&typeName=topp:tasmania_state_boundaries):
<?xml version="1.0" ?>
<ServiceExceptionReport
version=“1.2.0”
xmlns=“http://www.opengis.net/ogc”
xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance”
xsi:schemaLocation=“http://www.opengis.net/ogc http://schemas.opengis.net/wfs/1.0.0/OGC-exception.xsd”>
java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Collection
java.lang.String cannot be cast to java.util.Collection
I expected to get a response like this:
<?xml version="1.0" ?>
<ServiceExceptionReport
version=“1.2.0”
xmlns=“http://www.opengis.net/ogc”
xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance”
xsi:schemaLocation=“http://www.opengis.net/ogc http://schemas.opengis.net/wfs/1.0.0/OGC-exception.xsd”>
Could not determine geoserver request from http request …
Any idea?
···
2013/5/24 Frank Gasdorf <fgdrf@anonymised.com>
Thanks! I guess your hint about minOccurs should help to solve the problem. I had a second look at the DescribeFeatureType output and all values set to “0” (and maxOccurs is set to “1”) - sorry for this confusion and the clarification for POST request format itself.
2013/5/24 Andrea Aime <andrea.aime@anonymised.com>
On Fri, May 24, 2013 at 10:19 AM, Frank Gasdorf <fgdrf@anonymised.com> wrote:
Andrea, you are right, the used feature type has all minOccurs values set to “1” whereas nillable is set to “true”. Later confuses me a bit because mandatory properties which can be null? Or what does it mean if the property nillable is set tu true?
Used request : http://demo.opengeo.org/geoserver/topp/wfs?request=DescribeFeatureType&typeName=topp:tasmania_state_boundaries
No no, it means that all properties are optional
I had another look at your request, and it’s ill formed: you cannot do a POST request but do property selection in the url,
mixing the two styles for output format works just by accident.
This one if properly setup, and works as expected:
http://demo.opengeo.org/geoserver/topp/wfs?request=GetFeature&version=1.1.0&service=wfs&typeName=topp:tasmania_state_boundaries&propertyName=STATE&outputFormat=csv
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
On Fri, May 24, 2013 at 10:44 AM, Frank Gasdorf <fgdrf@anonymised.com
wrote:
BTW, I was wondering about the request URL, first I tried without
service=WFS and got an exception that doesn't say anything about the
missing required parameter (
http://demo.opengeo.org/geoserver/topp/wfs?request=GetFeature&version=1.0.0&outputFormat=csv&propertyName=STATE&typeName=topp:tasmania_state_boundaries
):
<?xml version="1.0" ?>
<ServiceExceptionReport
version="1.2.0"
xmlns="http://www.opengis.net/ogc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/ogc
http://schemas.opengis.net/wfs/1.0.0/OGC-exception.xsd">
<ServiceException>
java.lang.ClassCastException: java.lang.String cannot be cast to
java.util.Collection
java.lang.String cannot be cast to java.util.Collection
</ServiceException>
</ServiceExceptionReport>
The request was actually determined, but the wrong kvp parser was picked up
because the service was resolved
too late.
I've tried to solve this with this patch
http://jira.codehaus.org/browse/GEOS-4221, but unfortunately did not manage
to commit it back then.
There are a few of these around in GeoServer and GeoTools, where the patch
did not manage to get committed
when it was made, and then was sort of forgotten because it takes more time
than we have to refresh it to the current code.
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
-------------------------------------------------------
Thanks you both for your replies and hints.
OK, when minOccurs is set tu 0 and Nillable to true, it works fine for my
attributes. But there is still the FID column (as well as in your example
with Tasmania). Is it obligatory?
Tomas
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/wfs-gerefature-propertyName-problem-tp5055307p5055486.html
Sent from the GeoServer - User mailing list archive at Nabble.com.
Thanks you both for your replies and hints.
OK, when minOccurs is set tu 0 and Nillable to true, it works fine for my attributes. But there is still the FID column (as well as in your example with Tasmania). Is it obligatory?
Tomas
View this message in context: Re: wfs gerefature propertyName problem
Sent from the GeoServer - User mailing list archive at Nabble.com.
On Fri, May 24, 2013 at 11:01 AM, HerrFlick <tomas.mattern@anonymised.com> wrote:
Thanks you both for your replies and hints.
OK, when minOccurs is set tu 0 and Nillable to true, it works fine for my
attributes. But there is still the FID column (as well as in your example
with Tasmania). Is it obligatory?
Yes, it cannot be removed, most formats have the notion of an identifier
and the
code doing the property selection is shared.
I guess one could roll a vendor option specific for CSV that allows to drop
it...
it would require some coding.
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
-------------------------------------------------------