Reading data from shapefiles is supported by GeoTools. You need 
gt-shapefile (the shapefile plugin) and its dependencies.
http://docs.geotools.org/latest/userguide/library/data/datastore.html
http://docs.geotools.org/latest/userguide/library/data/shape.html

Your code should (see above examples):
- create a map of parameters
- use the map to find a DataStore
- use the DataStore to get a FeatureSource and then a FeatureCollection
- iterate over the features in the collection

Each feature will have a geometry (a JTS Geometry object). You can get 
the Coordinate Reference System from the schema (FeatureType). The 
geometry type can be determined from the JTS Geometry or from the schema.

Writing CSV is easy. I am sure you know how to do that. What sort of XML 
do you want to write? GeoTools has extensive support for encoding GML.

Kind regards,
Ben.


On 21/10/11 23:17, Jorge Castillo wrote:
> Hi everyone,
>
> I have to develop a GIS application and I need to extract information from a 
> shapefile and put it in a CSV or XML file and I want to know if it's possible 
> using GeoTools.
>
> The information I need is coordenates (x, y) and type of geometry associated 
> with those coordenates.
>
> If the answer is affirmative, wich module do I have to use to get it?
>
> Thanks in advance
>
>
> Jorge Castillo.
>

-- 
Ben Caradoc-Davies <[email protected]>
Software Engineer
CSIRO Earth Science and Resource Engineering
Australian Resources Research Centre

------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Cisco Self-Assessment and learn 
about Cisco certifications, training, and career opportunities. 
http://p.sf.net/sfu/cisco-dev2dev
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to