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
3
votes
2 answers

OpenLayers Projections

I can succesfully do: point.transform(new OpenLayers.Projection("EPSG:900913"), new OpenLayers.Projection("EPSG:4326")); To a point that is in the google format (in meters), but when I want to do the reverse: point.transform(new…
J.R.
  • 5,789
  • 11
  • 55
  • 78
2
votes
0 answers

Error in sp::CRS(SRS_string = "EPSG:24547") : NA

I am encountering an issue related to assigning CRS in sp package If I run: sp::CRS(SRS_string='EPSG:4326') sp::CRS("+init=epsg:4326") I get respectively those two errors: Error in sp::CRS(SRS_string = "EPSG:4326") : NA Error in…
Mukhtar Abdi
  • 391
  • 1
  • 12
2
votes
1 answer

I can't transform geometries to a projection defined in proj4.defs in openlayers 5.3

I have a Node mapping application that uses openlayers V5.3.0. When I try to transform geometries from EPSG:4326 to a projection defined using proj4.defs I get this error message: TypeError: Cannot read property 'getCode' of null If I change…
Graham H
  • 125
  • 12
2
votes
1 answer

Karma: proj4 is not a function

Really strange one. I have built an angular app with TeamCity and am trying to run karma tests as a build task: ng test 2 of the tests failed complaining about a missing dependency which happens to be proj4. Stepping through the failed test, this…
jenson-button-event
  • 18,101
  • 11
  • 89
  • 155
2
votes
1 answer

Adding Panoramio Photos To An OpenLayers Map

I have a pretty well integrated OpenLayers map that I want to add photos from the Panoramio API to. Unfortunately, it seems both API's are under documented on this subject. I found one great tutorial here…
elshae
  • 539
  • 3
  • 11
  • 30
2
votes
2 answers

Help with coordinates to plot on google map using api

i have got these two coordinates x and y from an external database. X = 30490, y = 31430 was trying to figure out how to plot these coordinates on to google map? As google map only accept lat and lon value... Any help is most appreciated!! Thanks...
Dayzza
  • 1,561
  • 7
  • 18
  • 29
2
votes
2 answers

Coordinates conversion

I am working over a small component for a web portal that show polygons over a map, using OpenLayers, Google Maps, and another proprietary source . The user has the points in PSAD56 (UTM) datum and I need to change it to WGS84 in order to use…
ric
  • 72
  • 1
  • 9
2
votes
1 answer

How to set default view in OpenLayers, WITHOUT restricting bounds?

Based on samples, I can see that you can set a default view in OpenLayers by saying something along the lines of: var bounds = new OpenLayers.Bounds(-125, 25, -65, 50); var map = new OpenLayers.Map('map', {restrictedExtent: bounds }); However,…
J.R.
  • 5,789
  • 11
  • 55
  • 78
2
votes
1 answer

How to reproject a vector layer when you switch between base maps of different projections

I have OpenLayers map with two base layers: MetaCarta (EPSG:4326) and Google map (Mercator). sphericalMercator = false, units are degrees. There are also some markers, boxes, and vector data on the map. When I switch between the base layers (which…
Zenya
  • 1,481
  • 1
  • 14
  • 25
2
votes
1 answer

Using Openlayers 3 and proj4js with RequireJS

I am experiencing an issue when using Openlayers 3 and proj4js with RequireJS. Using a standard JavaScript file and html, I have working code to display a map and show the coordinates in EPSG:27700 using an Openlayers mouse position control. When I…
gmccartney
  • 23
  • 3
2
votes
1 answer

Proj4Leaflet orign on custom projection

I've set up a Leaflet map using the fabulous Proj4Leaflet plugin. Within my map I'm using a custom reference system (EPSG:28533). The map tiles (WMTSCapabilities) are fetched and rendered. But I have encountered that the tiles are transformed to the…
CG_FD
  • 597
  • 1
  • 4
  • 15
2
votes
3 answers

lat/lon conversion to x/y-coordinates

I have a openstreetmap image. left upper corner is lat: 80 lon: -169 and right lower corner is lat:-56 lon: 190 The image has the width: 2618 and the height: 1513 How do I convert given lat/lon-coordinates to the pictures x/y-coordinates? I tried it…
alexschnalex
  • 21
  • 1
  • 3
2
votes
1 answer

How can I transform a custom overlay in Google Maps to account for projection?

I'm developing an application that uses Google Maps API v3. I want to make custom overlays that are squares exactly 1000km on each side (each overlay is actually a 1000x1000 transparent png, with each pixel representing 1 square km). My current…
roland
  • 950
  • 6
  • 13
2
votes
0 answers

Custom projection using proj4js

I need to redefine a Web Mercator Projection-like in order to have the projection centered on 180° instead of being centered on 0°. In order to make this I'm using proj4js Since the EPSG:3857 projection is defined like this…
tlebras
  • 185
  • 1
  • 2
  • 16
2
votes
2 answers

How to use OpenLayers 3 with Proj4js

I'm working on a map viewer project and used openlayers 2 before this. Now I have to use OpenLayers 3 and map viewer app should support many different projections because I have wms and wfs layers from different sources and projections. I've found…
Haktan Aydın
  • 581
  • 1
  • 6
  • 21
1 2
3
8 9