Angel, Eric wrote:
>
> http://docs.codehaus.org/display/GEOTDOC/04+How+to+Read+a+Shapefile
>
> I followed the above tutorial and have questions:
>
> Both 2.4 and 2.5 (at http://javadoc.geotools.fr/) documentation show 
> Feature.getDefaultGeometry() as being deprecated but don’t provide an 
> alternative.
>
> Neither 2.4 or 2.5 documentation show the Feature.getPrimaryGeometry().
>
> So which one should I use going forward? What’s the correct way to 
> extract the geometry?
>
I think you need to go up to the super class; ie SimpleFeature 
(http://geoapi.sourceforge.net/snapshot/javadoc/org/opengis/feature/simple/SimpleFeature.html):
- SimpleFeature.|*getDefaultGeometry 
<http://geoapi.sourceforge.net/snapshot/javadoc/org/opengis/feature/simple/SimpleFeature.html#getDefaultGeometry%28%29>*()|returns
 
the default geometry of a feature

And for the next super class, ie Feature 
(http://geoapi.sourceforge.net/snapshot/javadoc/org/opengis/feature/Feature.html)
 
we have:
- Feature.|*getDefaultGeometryProperty 
<http://geoapi.sourceforge.net/snapshot/javadoc/org/opengis/feature/Feature.html#getDefaultGeometryProperty%28%29>*()|
 


You can get the answer to these and many questions here:
- 
http://docs.codehaus.org/display/GEOTDOC/Feature+Model+Guide#FeatureModelGuide-GeometryValueAccess

If I have the example for how to read a shapefile wrong please let me 
know :-(
Jody

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to