Hi
I have a simplefeature type, and I can't parse the geometry out of it. I've
tried several ways and am out of ideas. Please help!
Ive tried
. the built in method feature.getDefaultGeometry()
. to get the geometry through AttributeDescriptors and
PropertyDescriptors
. iterating through the simplefeature properties and trying to get
the property with the "location" name
. I am now trying to parse the simplefeature into a string to use
simple regular expressions and it still skips over the geometry.
public static void parseGeom(SimpleFeatureCollection feature) throws
IOException{
GML encode = new GML(Version.WFS1_0);
ByteArrayOutputStream xml = new ByteArrayOutputStream();
encode.setNamespace("gml", "http://www.opengis.net/gml");
encode.encode(xml, feature);
xml.close();
String gml = xml.toString();
LOGGER.info(gml);
}
Here's the LOGGER.info(gml) output
22:17:04,281 INFO [mil.navy.fnmoc.gis.wps.ogp.Utils] (pool-15-thread-1)
<?xml version="1.0" encoding="UTF-8"?>
<wfs:FeatureCollection xmlns:ogc="http://www.opengis.net/ogc"
xmlns:gml="http://www.opengis.net/gml"
xmlns:wfs="http://www.opengis.net/wfs">
<gml:boundedBy>
<gml:null>unknown</gml:null>
</gml:boundedBy>
<gml:featureMember>
<null:buoyobservations fid="buoyobservations.43078">
<null:idbuoyobservation>43078</null:idbuoyobservation>
<null:ircs>0014553</null:ircs>
<null:sname></null:sname>
<null:issuetime>2013-08-19T18:00:00Z</null:issuetime>
<null:uploadtime>2013-08-19T20:24:11Z</null:uploadtime>
<null:idtokens>19083 18001 309754 061700</null:idtokens>
<null:class>U</null:class>
<null:pressmsl>1015.0</null:pressmsl>
<null:presstend>1.2</null:presstend>
<null:tempsea>25.9</null:tempsea>
<null:presstendglyph>2</null:presstendglyph>
</null:buoyobservations>
</gml:featureMember>
</wfs:FeatureCollection>
Here's the simplefeature:
<gml:featureMember>
<gis:buoyobservations fid="buoyobservations.43078">
<gis:idbuoyobservation>43078</gis:idbuoyobservation>
<gis:ircs>0014553</gis:ircs>
<gis:sname/>
<gis:issuetime>2013-08-19T18:00:00</gis:issuetime>
<gis:uploadtime>2013-08-19T20:24:11</gis:uploadtime>
<gis:idtokens>19083 18001 309754 061700</gis:idtokens>
<gis:class>U</gis:class>
<gis:pressmsl>1015.0</gis:pressmsl>
<gis:presstend>1.2</gis:presstend>
<gis:tempsea>25.9</gis:tempsea>
<gis:location>
<gml:Point srsName="http://www.opengis.net/gml/srs/epsg.xml#4326">
<gml:coordinates decimal="." cs="," ts="">61.701,9.755</gml:coordinates>
</gml:Point>
</gis:location>
<gis:presstendglyph>2</gis:presstendglyph>
</gis:buoyobservations>
</gml:featureMember>
smime.p7s
Description: S/MIME cryptographic signature
------------------------------------------------------------------------------ Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! Discover the easy way to master current and previous Microsoft technologies and advance your career. Get an incredible 1,500+ hours of step-by-step tutorial videos with LearnDevNow. Subscribe today and save! http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________ GeoTools-Devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geotools-devel
