<Placemark id="3">
        <description><![CDATA[ Foo HTML stuff ]]></description>

Here is my code:

   PullParser parser = new PullParser( new KMLConfiguration(), FileUtils.openInputStream(new File("foo.kml")), SimpleFeature.class);

    SimpleFeature simpleFeature (SimpleFeature)parser.parse();
    Object obj = simpleFeature.getAttribute("TimeStamp");
    //obj is null..does not parse TimeStamp?..
    Object objPoint = simpleFeature.getDefaultGeometry();
    //this works fine...objPoint is an instance of Point...

    Object objDescription = simpleFeature.getAttribute("description");
    //this works fine, objDescription is an instance of String with the   CDATA data there.             

for example

simpleFeature.getAttribute("description"), will return a String of the content of the description which in the above KML is CDATA stuff...


, however TimeStamp is null :( ..I would have expected a Timestamp or a list of Date(s)?

is there a way to get the TimeStamp from the above KML with geotools without custom parsing?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.