[Geoserver-users] Possible Bug in WFS GetFeature JSON response?

Hey folks,

Is there a bug in outputformat=json for GetFeature?

There appears to be an error (included below) when one attempts to have a wfs getfeature with outputformat=json return geometry, as well as when one makes the requests without a propertyname field. This may be the same error, representing both an explicit and implicit attempt to get geometry. Has anyone encountered this bug (I didn’t see it in jira), or does anyone see an obvious error in my URLs?

Errors are demonstrated using MassGIS webservices… I think they’re on 1.6.5.

Working WFS-JSON
http://giswebservices.massgis.state.ma.us/geoserver/wfs?typename=massgis:GISDATA.USGSGRID_POLY&propertyname=QUAD_NAME,DIG_ID&request=getfeature&version=1.1.0&service=wfs&cql_filter=INTERSECT(SHAPE,POINT(237914.77%20945347.5))&outputformat=json

Not working WFS-JSON with explicit naming of geometry field (SHAPE for massgis layers)
http://giswebservices.massgis.state.ma.us/geoserver/wfs?typename=massgis:GISDATA.USGSGRID_POLY&propertyname=QUAD_NAME,SHAPE&request=getfeature&version=1.1.0&service=wfs&cql_filter=INTERSECT(SHAPE,POINT(237914.77%20945347.5))&outputformat=json

Not working WFS-JSON with no explict request of fields (ie: implicit request of all fields, including SHAPE)
http://giswebservices.massgis.state.ma.us/geoserver/wfs?typename=massgis:GISDATA.USGSGRID_POLY&propertyname=QUAD_NAME,SHAPE&request=getfeature&version=1.1.0&service=wfs&cql_filter=INTERSECT(SHAPE,POINT(237914.77%20945347.5))&outputformat=json

Error Message
<ows:ExceptionReport version=“1.0.0” xsi:schemaLocation=“http://www.opengis.net/ows http://giswebservices.massgis.state.ma.us:80/geoserver/schemas/ows/1.0.0/owsExceptionReport.xsd”>
<ows:Exception exceptionCode=“NoApplicableCode”>
ows:ExceptionTextjava.util.NoSuchElementException null</ows:ExceptionText>
</ows:Exception>
</ows:ExceptionReport>

For reference, here are our not working WFS-JSON calls, with the &outputformat=json removed, to demonstrate that they work as WFS-XML calls.

Working WFS-XML with explicit naming of geometry field (SHAPE for massgis layers)
http://giswebservices.massgis.state.ma.us/geoserver/wfs?typename=massgis:GISDATA.USGSGRID_POLY&propertyname=QUAD_NAME,SHAPE&request=getfeature&version=1.1.0&service=wfs&cql_filter=INTERSECT(SHAPE,POINT(237914.77%20945347.5))

Working WFS-XML with no explict request of fields (ie: implicit request of all fields, including SHAPE)
http://giswebservices.massgis.state.ma.us/geoserver/wfs?typename=massgis:GISDATA.USGSGRID_POLY&request=getfeature&version=1.1.0&service=wfs&cql_filter=INTERSECT(SHAPE,POINT(237914.77%20945347.5))

Josh Rosenthal ha scritto:

Hey folks,

Is there a bug in outputformat=json for GetFeature?

There appears to be an error (included below) when one attempts to have a wfs getfeature with outputformat=json return geometry, as well as when one makes the requests without a propertyname field. This may be the same error, representing both an explicit and implicit attempt to get geometry. Has anyone encountered this bug (I didn't see it in jira), or does anyone see an obvious error in my URLs?

Errors are demonstrated using MassGIS webservices... I think they're on 1.6.5. <http://1.6.5.>

Working WFS-JSON
http://giswebservices.massgis.state.ma.us/geoserver/wfs?typename=massgis:GISDATA.USGSGRID_POLY&propertyname=QUAD_NAME,DIG_ID&request=getfeature&version=1.1.0&service=wfs&cql_filter=INTERSECT(SHAPE,POINT(237914.77%20945347.5))&outputformat=json <http://giswebservices.massgis.state.ma.us/geoserver/wfs?typename=massgis:GISDATA.USGSGRID_POLY&propertyname=QUAD_NAME,DIG_ID&request=getfeature&version=1.1.0&service=wfs&cql_filter=INTERSECT(SHAPE,POINT(237914.77%20945347.5))&outputformat=json&gt;

Not working WFS-JSON with explicit naming of geometry field (SHAPE for massgis layers)
http://giswebservices.massgis.state.ma.us/geoserver/wfs?typename=massgis:GISDATA.USGSGRID_POLY&propertyname=QUAD_NAME,SHAPE&request=getfeature&version=1.1.0&service=wfs&cql_filter=INTERSECT(SHAPE,POINT(237914.77%20945347.5))&outputformat=json <http://giswebservices.massgis.state.ma.us/geoserver/wfs?typename=massgis:GISDATA.USGSGRID_POLY&propertyname=QUAD_NAME,SHAPE&request=getfeature&version=1.1.0&service=wfs&cql_filter=INTERSECT(SHAPE,POINT(237914.77%20945347.5))&outputformat=json&gt;

Not working WFS-JSON with no explict request of fields (ie: implicit request of all fields, including SHAPE)
http://giswebservices.massgis.state.ma.us/geoserver/wfs?typename=massgis:GISDATA.USGSGRID_POLY&propertyname=QUAD_NAME,SHAPE&request=getfeature&version=1.1.0&service=wfs&cql_filter=INTERSECT(SHAPE,POINT(237914.77%20945347.5))&outputformat=json <http://giswebservices.massgis.state.ma.us/geoserver/wfs?typename=massgis:GISDATA.USGSGRID_POLY&propertyname=QUAD_NAME,SHAPE&request=getfeature&version=1.1.0&service=wfs&cql_filter=INTERSECT(SHAPE,POINT(237914.77%20945347.5))&outputformat=json&gt;

Error Message
<ows:ExceptionReport version="1.0.0" xsi:schemaLocation="http://www.opengis.net/ows http://giswebservices.massgis.state.ma.us:80/geoserver/schemas/ows/1.0.0/owsExceptionReport.xsd&quot;&gt;
<ows:Exception exceptionCode="NoApplicableCode">
<ows:ExceptionText>java.util.NoSuchElementException null</ows:ExceptionText>
</ows:Exception>
</ows:ExceptionReport>

For reference, here are our not working WFS-JSON calls, with the &outputformat=json removed, to demonstrate that they work as WFS-XML calls.

Working WFS-XML with explicit naming of geometry field (SHAPE for massgis layers)
http://giswebservices.massgis.state.ma.us/geoserver/wfs?typename=massgis:GISDATA.USGSGRID_POLY&propertyname=QUAD_NAME,SHAPE&request=getfeature&version=1.1.0&service=wfs&cql_filter=INTERSECT(SHAPE,POINT(237914.77%20945347.5)) <http://giswebservices.massgis.state.ma.us/geoserver/wfs?typename=massgis:GISDATA.USGSGRID_POLY&propertyname=QUAD_NAME,SHAPE&request=getfeature&version=1.1.0&service=wfs&cql_filter=INTERSECT(SHAPE,POINT(237914.77%20945347.5))&gt;

Working WFS-XML with no explict request of fields (ie: implicit request of all fields, including SHAPE)
http://giswebservices.massgis.state.ma.us/geoserver/wfs?typename=massgis:GISDATA.USGSGRID_POLY&request=getfeature&version=1.1.0&service=wfs&cql_filter=INTERSECT(SHAPE,POINT(237914.77%20945347.5)) <http://giswebservices.massgis.state.ma.us/geoserver/wfs?typename=massgis:GISDATA.USGSGRID_POLY&request=getfeature&version=1.1.0&service=wfs&cql_filter=INTERSECT(SHAPE,POINT(237914.77%20945347.5))&gt;

Looks like a bug indeed. Can you open a bug report at jira.codehaus.org?
This way you'll be informed of our progress fixing it.
Cheers
Andrea

Done, though I wasn’t sure what to put for the version it affects. I believe massgis is running 1.6.5 beta, but… I’m entirely on the user end of things.

Also… at the risk of asking, is there any version ETA for adding JSONP support? - Tim Schaub posted to Jira about a year ago as: GEOS-1411 - Allow for optional callback parameter in GET requests that return json formatted structures? I’ve got a proxy set up to wrap the responses in the meantime, but was kind of curious if we’d see it in 1.7.0, or if its expected to be later still.

Thanks a lot!
josh

On Mon, Sep 1, 2008 at 10:42 AM, Andrea Aime <aaime@anonymised.com> wrote:

Josh Rosenthal ha scritto:

Hey folks,

Is there a bug in outputformat=json for GetFeature?

There appears to be an error (included below) when one attempts to have a wfs getfeature with outputformat=json return geometry, as well as when one makes the requests without a propertyname field. This may be the same error, representing both an explicit and implicit attempt to get geometry. Has anyone encountered this bug (I didn’t see it in jira), or does anyone see an obvious error in my URLs?

Errors are demonstrated using MassGIS webservices… I think they’re on 1.6.5. <http://1.6.5.>
Working WFS-JSON
http://giswebservices.massgis.state.ma.us/geoserver/wfs?typename=massgis:GISDATA.USGSGRID_POLY&propertyname=QUAD_NAME,DIG_ID&request=getfeature&version=1.1.0&service=wfs&cql_filter=INTERSECT(SHAPE,POINT(237914.77%20945347.5))&outputformat=json <http://giswebservices.massgis.state.ma.us/geoserver/wfs?typename=massgis:GISDATA.USGSGRID_POLY&propertyname=QUAD_NAME,DIG_ID&request=getfeature&version=1.1.0&service=wfs&cql_filter=INTERSECT%28SHAPE,POINT%28237914.77%20945347.5%29%29&outputformat=json>

Not working WFS-JSON with explicit naming of geometry field (SHAPE for massgis layers)

http://giswebservices.massgis.state.ma.us/geoserver/wfs?typename=massgis:GISDATA.USGSGRID_POLY&propertyname=QUAD_NAME,SHAPE&request=getfeature&version=1.1.0&service=wfs&cql_filter=INTERSECT(SHAPE,POINT(237914.77%20945347.5))&outputformat=json <http://giswebservices.massgis.state.ma.us/geoserver/wfs?typename=massgis:GISDATA.USGSGRID_POLY&propertyname=QUAD_NAME,SHAPE&request=getfeature&version=1.1.0&service=wfs&cql_filter=INTERSECT%28SHAPE,POINT%28237914.77%20945347.5%29%29&outputformat=json>

Not working WFS-JSON with no explict request of fields (ie: implicit request of all fields, including SHAPE)

http://giswebservices.massgis.state.ma.us/geoserver/wfs?typename=massgis:GISDATA.USGSGRID_POLY&propertyname=QUAD_NAME,SHAPE&request=getfeature&version=1.1.0&service=wfs&cql_filter=INTERSECT(SHAPE,POINT(237914.77%20945347.5))&outputformat=json <http://giswebservices.massgis.state.ma.us/geoserver/wfs?typename=massgis:GISDATA.USGSGRID_POLY&propertyname=QUAD_NAME,SHAPE&request=getfeature&version=1.1.0&service=wfs&cql_filter=INTERSECT%28SHAPE,POINT%28237914.77%20945347.5%29%29&outputformat=json>

Error Message
<ows:ExceptionReport version=“1.0.0” xsi:schemaLocation=“http://www.opengis.net/ows http://giswebservices.massgis.state.ma.us:80/geoserver/schemas/ows/1.0.0/owsExceptionReport.xsd”>
<ows:Exception exceptionCode=“NoApplicableCode”>
ows:ExceptionTextjava.util.NoSuchElementException null</ows:ExceptionText>
</ows:Exception>
</ows:ExceptionReport>

For reference, here are our not working WFS-JSON calls, with the &outputformat=json removed, to demonstrate that they work as WFS-XML calls.

Working WFS-XML with explicit naming of geometry field (SHAPE for massgis layers)

http://giswebservices.massgis.state.ma.us/geoserver/wfs?typename=massgis:GISDATA.USGSGRID_POLY&propertyname=QUAD_NAME,SHAPE&request=getfeature&version=1.1.0&service=wfs&cql_filter=INTERSECT(SHAPE,POINT(237914.77%20945347.5)) <http://giswebservices.massgis.state.ma.us/geoserver/wfs?typename=massgis:GISDATA.USGSGRID_POLY&propertyname=QUAD_NAME,SHAPE&request=getfeature&version=1.1.0&service=wfs&cql_filter=INTERSECT%28SHAPE,POINT%28237914.77%20945347.5%29%29>

Working WFS-XML with no explict request of fields (ie: implicit request of all fields, including SHAPE)

http://giswebservices.massgis.state.ma.us/geoserver/wfs?typename=massgis:GISDATA.USGSGRID_POLY&request=getfeature&version=1.1.0&service=wfs&cql_filter=INTERSECT(SHAPE,POINT(237914.77%20945347.5)) <http://giswebservices.massgis.state.ma.us/geoserver/wfs?typename=massgis:GISDATA.USGSGRID_POLY&request=getfeature&version=1.1.0&service=wfs&cql_filter=INTERSECT%28SHAPE,POINT%28237914.77%20945347.5%29%29>

Looks like a bug indeed. Can you open a bug report at jira.codehaus.org?
This way you’ll be informed of our progress fixing it.
Cheers
Andrea

Josh Rosenthal ha scritto:

Done, though I wasn't sure what to put for the version it affects. I believe massgis is running 1.6.5 beta, but... I'm entirely on the user end of things.

Also... at the risk of asking, is there any version ETA for adding JSONP support? - Tim Schaub posted to Jira about a year ago as: GEOS-1411 <http://jira.codehaus.org/browse/GEOS-1411&gt; - Allow for optional callback parameter in GET requests that return json formatted structures? I've got a proxy set up to wrap the responses in the meantime, but was kind of curious if we'd see it in 1.7.0, or if its expected to be later still.

Definitely not for 1.7.0.... we can try to schedule if for 1.7.1, so
far it has not been fixed because Tim reported it as a "would be nice"
one and not being a javascript developer I'm not sure how to test it
out either... if you are interested in testing this out, we can
code it (seems simple enough) some time after FOSS4G (this month
we're booked solid I fear).

Cheers
Andrea

I’d be happy to help with testing it, but I’m not set up with anywhere I can install geoserver at the moment. If on the other hand, someone points me towards a nominally working install… running a few different tests should be extremely trivial. Let me know when the schedule frees up, and I can be of help.

Two samples of JSON-P calls
http://ws.geonames.org/citiesJSON?north=44.1&south=-9.9&east=-22.4&west=55.2&lang=de &callback=foo
http://search.yahooapis.com/ImageSearchService/V1/imageSearch?appid=YahooDemo&query=Geoserver&output=json&callback=ws_results.obj.array[4]

Thanks muchly,

Josh

On Mon, Sep 1, 2008 at 11:08 AM, Andrea Aime <aaime@anonymised.com> wrote:

Josh Rosenthal ha scritto:

Done, though I wasn’t sure what to put for the version it affects. I believe massgis is running 1.6.5 beta, but… I’m entirely on the user end of things.

Also… at the risk of asking, is there any version ETA for adding JSONP support? - Tim Schaub posted to Jira about a year ago as: GEOS-1411 <http://jira.codehaus.org/browse/GEOS-1411> - Allow for optional callback parameter in GET requests that return json formatted structures? I’ve got a proxy set up to wrap the responses in the meantime, but was kind of curious if we’d see it in 1.7.0, or if its expected to be later still.

Definitely not for 1.7.0.… we can try to schedule if for 1.7.1, so
far it has not been fixed because Tim reported it as a “would be nice”
one and not being a javascript developer I’m not sure how to test it
out either… if you are interested in testing this out, we can
code it (seems simple enough) some time after FOSS4G (this month
we’re booked solid I fear).

Cheers
Andrea