Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I'm using a postgis database and java to develop my application. I need to transform my geographic data currently in latitude/longitude format into a x/y format. I found solutions based on UTM coordinates, however points in different zones are a problem. I'm looking for a java library or a algorithm that does exactly this: http://www.whoi.edu/marine/ndsf/cgi-bin/NDSFutility.cgi?form=0&from=LatLon&to=XY

Given two lat/lon coordinates, one of them for origin, the output is x and y in meters. Thank you for your time

share|improve this question
1  
A comment at this nearly identical (but unanswered) question has a link to a Java Map Projection Library; many Java-related questions mention GeoTools. –  whuber Mar 11 '13 at 18:44
1  
Do you want to emulate the exact map projection? I think you'll have to ask them plus what earth model is being used. It looks like some sort of azimuthal projection. –  mkennedy Mar 11 '13 at 19:33
add comment

1 Answer 1

I assume your data are stored inside a postgis db. You can use postgis functions to do the transformations directly. No need for external libs

select 
    st_x(st_transform(geom,<SRID>) as X, 
    st_y(st_transform(geom,<srid>) as Y 
from 
    mTable 
where 
    ...
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.