I have coordinate system with x and y. Also I need to show there x,y point but I have coordinates latitude, longitude.
How can I transform latitude, longitude into x,y to show on x,y scale?
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It only takes a minute to sign up.
Sign up to join this communityI have coordinate system with x and y. Also I need to show there x,y point but I have coordinates latitude, longitude.
How can I transform latitude, longitude into x,y to show on x,y scale?
Try this :
import com.vividsolutions.jts.geom.Coordinate;
import javax.measure.unit.NonSI;
import org.jscience.geography.coordinates.LatLong;
import org.jscience.geography.coordinates.UTM;
import org.jscience.geography.coordinates.crs.ReferenceEllipsoid;
This method makes the conversion in JAVA and return a Coordinate. Is easy to obtain X and Y from Coordinate
public static Coordinate Polar2UTM(double latitude, double longitude) {
LatLong latlong = LatLong.valueOf(latitude, longitude, NonSI.DEGREE_ANGLE);
UTM utm = UTM.latLongToUtm(latlong, ReferenceEllipsoid.WGS84);
double cX = utm.getCoordinates()[0];
double cY = utm.getCoordinates()[1];
Coordinate coordenadas = new Coordinate(cX, cY);
}
If you are trying to convert (x, y) to/from (latitude and longitude)
Have a look at the various code implementations on this page.
Here are two JavaScript function examples...
mercator; //output mercator.x, mercator.y
latlon; //output latlon.lat, latlon.lon
You will need to have the measurements for your map.