Questions tagged [proj4js]

Proj4JS is an open source JavaScript library that transforms map coordinates between different coordinate systems and projections.

Described as being a JavaScript port of the popular Proj.4 C library, in reality Proj4JS is only a loose port. It is a little easier to use, but can use the same specifications (eg. abbreviations for specific projections).

Due to its use as a client JavaScript lbirary, Proj4JS is much more lightweight. Whilst Proj.4 supports all but the most esoteric continuous map projections, Proj4JS only supports a subset of the most popular. Similarly, Proj.4 can be loaded with databases of various coordinate systems (eg. EPSG codes) but Proj4JS is usually only loaded with a handful of those used at runtime.

Further information and source code can be found here:

http://proj4js.org/

123 questions
31
votes
13 answers

How to convert from UTM to LatLng in python or Javascript

I have a bunch of files with coordinates in UTM form. For each coordinate I have easting, northing and zone. I need to convert this to LatLng for use with Google Map API to show the information in a map. I have found some online calculators that…
Staale
  • 27,254
  • 23
  • 66
  • 85
21
votes
2 answers

How to convert Vector Layer coordinates into Map Latitude and Longitude in Openlayers

I'm pretty confused. I have a point: x= -12669114.702301 y= 5561132.6760608 That I got from drawing a square on a vector layer with the DrawFeature controller. The numbers seem...erm...awfull large, but they seem to work, because if I later draw a…
J.R.
  • 5,789
  • 11
  • 55
  • 78
19
votes
10 answers

Mercator longitude and latitude calculations to x and y on a cropped map (of the UK)

I have this image. It's a map of the UK (not including Southern Ireland): I have successfully managed to get a latitude and longitude and plot it onto this map by taking the leftmost longitude and rightmost longitude of the UK and using them to…
betamax
  • 13,431
  • 9
  • 38
  • 55
17
votes
9 answers

Where can I find the coordinates needed to draw the US in the Mercator projection?

So I'm writing a Javascript library that takes x,y coordinates and uses them to draw a map of the US. To do this, I need to find the coordinate data necessary to draw each state. This map on Wikipedia is a great example of what I need, because the…
Eli Courtwright
  • 186,300
  • 67
  • 213
  • 256
17
votes
3 answers

Convert Lat/Longs to X/Y Co-ordinates

I have the Lat/Long value of New York City, NY; 40.7560540,-73.9869510 and a flat image of the earth, 1000px × 446px. I would like to be able to convert, using Javascript, the Lat/Long to an X,Y coordinate where the point would reflect the…
donohoe
  • 13,867
  • 4
  • 37
  • 59
16
votes
3 answers

How to transform a distance from degrees to metres?

I'm using OpenLayers with an ordinary mercator map and I'm trying to sample a bounding box by finding a grid of points in latlong. The bbox is expressed in latlon, e.g. 48.1388,-15.3616,55.2057,-3.9359 I can define a distance in degrees (e.g. x:…
Mulone
  • 3,603
  • 9
  • 47
  • 69
9
votes
1 answer

How to transform coordinate from WGS84 to a coordinate in a projection with PROJ.4?

I have a GPS-coordinate in WGS84 that I would like to transform to a map-projection coordinate in SWEREF99 TM using PROJ.4 in Java or Proj4js in JavaScript. Its hard to find documentation for PROJ.4 and how to use it. If you have a good link, please…
Jonas
  • 121,568
  • 97
  • 310
  • 388
8
votes
0 answers

Leaflet map with WMS and custom projection

I have implemented a map using Leaflet and tiles from a WMS-service. They offer a list of projections, where of one is usable in standard Leaflet EPSG:4326. However, the map looks a bit distorted, and I recon one of the other projections would be…
Steen
  • 2,749
  • 2
  • 20
  • 36
7
votes
1 answer

Figuring out Latitude and Longitude from XY Image

I'm having difficulty calculating the latitude and longitude values of an image that I am hosting inside of a div tag on my webpage. I can easily figure out the x,y (pixel) coordinates of the image and save them to a variable inside of my script. …
wuffwuff
  • 730
  • 2
  • 9
  • 19
7
votes
3 answers

PROJ.4 library and OSGB36

hope you are well I am trying to convert lat/long coordinates to OSGB36 x and y using the proj.4 library. Has anyone else successfully done this? I need to fill the srcPrj4String and destPrj4String variables, e.g. string srcPrj4String =…
leddy
  • 531
  • 3
  • 13
  • 31
6
votes
1 answer

Mercator projection world map with Geoserver and Openlayers

I'm trying to render a world map shapefile on my Geoserver with a Mercator projection. I've tried declaring the SRS on Geoserver and defining EPSG projections of 3785 or 900913 in Openlayers with no success. I've also tried to reproject the…
bjaxbjax
  • 1,351
  • 2
  • 15
  • 24
6
votes
7 answers

Converting latitude/longitude to Alberta 10 TM Projection

I need to convert latitude/longitude coordinates into Easting/Northing coordinates in the Alberta 10 TM Projection. The 10 TM projection is similar to UTM, but it is a custom projection for the province of Alberta, Canada. I think (with some…
Michael Sharek
  • 5,043
  • 2
  • 30
  • 33
6
votes
1 answer

OpenLayers Google Maps Projection Problem w/ KML

This is my first time on stackoverflow and working with Openlayers & Google Maps. I've been browsing different forums & sites, including OpenLayers.org, to solve my issue. I've done searches on a combination of the following: openlayers, google map…
Tiffany
  • 151
  • 2
  • 7
4
votes
2 answers

angular & migration openlayers to ol & proj4js

Tried to migrate an angular-based project using openlayers away from deprecated openlayers-npm-package to recommended ol-npm-package. By debugging i realized that i had a problem with the previously still working integration of proj4. After two days…
user10324080
  • 121
  • 8
4
votes
1 answer

How to import Proj4js to use with Highmaps?

I have a Vue application that is using highchart with the vue-highcart component to plot maps. I need to plot points on this maps based on the Latitude and Longitude and, according to Highmaps documentation, I have to use the Proj4js. In plain old…
João Menighin
  • 3,083
  • 6
  • 38
  • 80
1
2 3
8 9