Hi, I have GeoServer that produces me a GML to layers that I store in the geoserver. The gml is basically looks like this: <wfs:FeatureCollection (some data about the xml tags)> <wfs:featureMember> . . .
The thing that specail in my GML is that it contains Features that are Polygons and MultiPolygons. I want to parse that GML to a FeatureCollection and then to a GeoJson. I know how to parse from feature collection to geojson.
Now to parse the GML i used all sort of things: WFSConfiguration, GML = new GML(Version.WFS1_0) and the problem is that I always gets a SimpleFeatureCollection with Only Polygons. I focus the problem and found out that the geometry of the first feature in my GML is the geometry that all the features will be parsed too. For example, My case i had some features at the top of the GML that their geometry was Polygon and in the middle i had a feature that was MultiPolygon and it was parsed to a Polygon in the parsed SimpleFeatureCollection i got.
I looked everywhere for some help but didnt found anything about this problem. Maybe i'm not suppose to have different geometries in SimpleFeatureCollection but MultiPolygon with Polygon does sounds like they can be together. The problem isnt only with Polygon and MultiPolygon one time i put a Point Feature as the first feature in my GML file and some plygon features after it and they all been parsed to points....
I would appreciate if anyone could help me and if needed more information just let me know.
|