Issue Type: Bug Bug
Assignee: Andrea Aime
Created: 15/Apr/13 3:35 AM
Description:

There is a bug in GeoServer when working with GeometryCollections and JSON-output-format in a WFS-GetFeature-request.

see related post in Mailing List:

http://osgeo-org.1560.x6.nabble.com/JSON-output-through-the-WFS-fails-td3786946.html

I could find and fix the problem in my local GeoServer-sourcecode.

Here is the solution:

It is a just a small problem when writing the JSON-Object.

File: GeoJSONBuilder.java

Function: writeGeomCollection (line 109)

In the code when writing a GeometryCollection, first the array gets created and then the key "Geometries" gets written. You have to switch the two lines, and the JSON-Output for GeometryCollection will work fine.

private JSONBuilder writeGeomCollection(GeometryCollection collection) {
//IMPORTANT geometries-key must be written before creating array
this.key("geometries");
this.array();

for (int i = 0, n = collection.getNumGeometries(); i < n; i++)

{ writeGeom(collection.getGeometryN(i)); }

return this.endArray();
}

Project: GeoServer
Priority: Major Major
Reporter: Paul Biskup
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Reply via email to