All;

I've been working with the parser to open and read KML files, and produce jts 
Geometries. The examples I found on the geotools site and elsewhere make it 
relatively simple except that the latitude and longitude are reversed from the 
values in the KML.

I found the documentation entry 
(http://docs.geotools.org/latest/userguide/library/referencing/order.html) that 
says to set the forceXY property to true, but that does not seem to work. I'm 
running a web application using Spring 4 and have tried inserting the 
System.setProperty call in the constructor method for my geotools service, and 
I found a sample to put in my application.xml file, but neither force the 
lon/lat format on the output. Here's the setup code:

                                InputStream inputStream = new 
FileInputStream(file);
                                Parser parser = new Parser(new 
KMLConfiguration());
                                SimpleFeature f = (SimpleFeature) parser.parse( 
inputStream );
                                Collection<SimpleFeature> features = 
(Collection<SimpleFeature>) f.getAttribute("Feature");

By the time I get to the third step, everything has been parsed as lat/lon. I 
don't see any arguments for the KMLConfiguration() that would allow me to 
specify the forceXY or anything else.

I'm using geotools 12.2. Does anyone have any suggestions?


______________________________________
Randall S. (Randy) Avis
Senior Software Engineer
KEYW Corporation
571-421-8566 (office)
703-609-7837 (cell)
ra...@keywcorp.com<mailto:ra...@keywcorp.com>

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to