Hi Masch:
This is going to be a very hard one for anyone to help you with ... unless your
shapefile has a ".prj" file. Can you check?
The thing is the shapefile is recorded against a specific model of the world
described by a CoordinateReferenceSystem. GeoTools can help transform your
geometry into lat/lon - but you need to tell it what your data is measured in
first.
Do you mind going through the tutorials on this topic; and then coming back if
you have any more questions? (The tutorials have pictures and everything):
- http://docs.geotools.org/latest/userguide/tutorial/geometry/geometrycrs.html
- slides:
http://how2map.blogspot.com/2011/11/osdc-2011-geospatial-for-java-workshop.html
Best of luck
--
Jody Garnett
On Sunday, 11 December 2011 at 4:44 PM, the.masch wrote:
> Hello, first at all, this is my first time with geography data, so I am sorry
> if I am asking something wrong. The thing that I used your web page to parse
> some SHAPE file It is working fine, but I do not understand the data format
> from the Geometry source. This is an example:
>
> SimpleFeatureIterator iterator = features.features();
> try {
> while (iterator.hasNext()) {
> SimpleFeature feature = iterator.next();
> Geometry geom = (Geometry) feature.getDefaultGeometry();
> Point centroid = geom.getCentroid();
> /*
> Value of centroid -> POINT (107780.29096944424
> 105247.95770896814)
> */
> }
> } finally {
> iterator.close(); // IMPORTANT
> }
>
> Could you help me to convert that value to Decimal Latitude and Longitude,
> please? I am searching on "Google", but I cannot find how to convert it.
>
> Thank you very much I am sorry if I am asking something that it is not
> strictly geotools functionality.
>
> salu2...
> masch...
>
> ------------------------------------------------------------------------------
> Learn Windows Azure Live! Tuesday, Dec 13, 2011
> Microsoft is holding a special Learn Windows Azure training event for
> developers. It will provide a great way to learn Windows Azure and what it
> provides. You can attend the event by watching it streamed LIVE online.
> Learn more at http://p.sf.net/sfu/ms-windowsazure
>
> _______________________________________________
> Geotools-gt2-users mailing list
> [email protected]
> (mailto:[email protected])
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>
>
------------------------------------------------------------------------------
Learn Windows Azure Live! Tuesday, Dec 13, 2011
Microsoft is holding a special Learn Windows Azure training event for
developers. It will provide a great way to learn Windows Azure and what it
provides. You can attend the event by watching it streamed LIVE online.
Learn more at http://p.sf.net/sfu/ms-windowsazure
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users