2

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.

2

1 Answer 1

3

I assume your data are stored inside a PostGIS database. You can use PostGIS functions to do the transformations directly. No need for external libraries.

    select 
        st_x(st_transform(geom,<SRID>)) as X, 
        st_y(st_transform(geom,<srid>)) as Y 
    from 
        mTable 
    where 
        ...
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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