Questions tagged [mercator]

The Mercator projection is a popular map projection, though it distorts the size and shape of large objects, as the scale increases from the Equator to the poles.

The Mercator projection is a popular map projection, though it distorts the size and shape of large objects, as the scale increases from the Equator to the poles.

http://en.wikipedia.org/wiki/Mercator_projection

119 questions
77
votes
6 answers

Convert latitude/longitude point to a pixels (x,y) on mercator projection

I'm trying to convert a lat/long point into a 2d point so that I can display it on an image of the world-which is a mercator projection. I've seen various ways of doing this and a few questions on stack overflow-I've tried out the different code…
drunkmonkey
  • 1,111
  • 1
  • 17
  • 27
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
12
votes
3 answers

OpenLayers : How to calculate distance between two points?

How can one calculate the distance in OpenLayers between 2 points using Mercator projection? Thanks
Jimmy
  • 123
  • 1
  • 1
  • 5
11
votes
3 answers

How to convert radius in metres to pixels in mapbox leaflet?

I am working on an application where I am trying to run some algorithms on a map and calculate coords but they are slightly off because I am running the calculations on latitude and longitudes and the final results are getting distorted. Now I am…
Rohan
  • 13,308
  • 21
  • 81
  • 154
8
votes
1 answer

how to Convert Lat ,long to an XY coordinate system (e.g. UTM) and then map this to pixel space of my Image

I have a very small area map , which I downloaded from Openstreet map(PNG) and also its OSM(.osm) file which contains its Lat ,long. Now I want to convert Lat ,long to an XY coordinate system (e.g. UTM) and then map this to pixel space of my Image…
Verve Innovation
  • 2,006
  • 6
  • 29
  • 48
8
votes
2 answers

Wrapping great circles with Mercator maps with D3.js, Leaflet, or Mapbox

The question, in short: How can I accurately project a wrapping great circle radius in Mercator using something other than the Google Maps API? The question, in long: So I've got a conundrum. I run a mapping application that uses Google Maps API to…
nucleon
  • 861
  • 6
  • 22
7
votes
1 answer

Mercator map projection logic conflict

I'm looking for an explanation on why there are 2 different mercator formulas discussed on these sites. I understand this to be the correct mercator projection algorithm: http://en.wikipedia.org/wiki/Mercator_projection y = ln|sec(lat) + tan(lat)|…
glutz
  • 1,889
  • 7
  • 29
  • 44
7
votes
1 answer

D3 mercator function NaN

I'm not too familiar with the D3 mercator projection function, and I'm getting some unexpected results. I'd like to project the following latitude and longitude (somewhere in Mexico): var geo = [19, -99] I define my mercator projection using d3 var…
Michael
  • 7,087
  • 21
  • 52
  • 81
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
2 answers

Common Mercator Projection formulas for Google Maps not working correctly

I am building a Tile Overlay server for Google maps in C#, and have found a few different code examples for calculating Y from Latitude. After getting them to work in general, I started to notice certain cases where the overlays were not lining up…
Tom Halladay
  • 5,651
  • 6
  • 46
  • 65
5
votes
1 answer

Message "d3.js TypeError: n is undefined" (for D3 world map with force layout)

I was trying out the code from this site: http://bl.ocks.org/bycoffe/3230965 I keep having the error that "n is undefined". Upon further scaling down, i have come to the conclusion that the problem is with these lines: (function() { var width…
user2972046
  • 51
  • 1
  • 2
4
votes
1 answer

Calculating Mercator d3 scaling to match Leaflet zoom level

Given a Leaflet zoom level (0..22), how would I calculate D3 scaling value for geoMercator projection? At zoom=0, the whole world fits within a single tile (256x256). In tiles, the world size is 2^zoom x 2^zoom tiles.
Yuri Astrakhan
  • 8,808
  • 6
  • 63
  • 97
4
votes
1 answer

How to label cities in a Geographical Map using D3.js?

I am using D3.js to draw the geographical map of USA using Mercator projection. The map represents the population in each city across the USA. The population data is stored in the following…
User456898
  • 5,704
  • 5
  • 21
  • 37
4
votes
0 answers

Trying to create a d3 map in a reactjs component, by sending the data as prop from parent component

I’m trying to create a world map with d3 in a react component. I want to send the data as a prop to the map. I believe I need to take the topoJSON file and create a geoJSON file(array) of geometries in the app component and then send this to the map…
ang45
  • 41
  • 3
3
votes
1 answer

calculate tile size of google map at zoom level n

Hey. I have a maps application that uses google maps. I get the bounds off the map, and then I do some clustering markers on that grounds, but to be able to have the clusters stay at the same place, I'd like to know how to make the boundaries that I…
Jakob
  • 4,784
  • 8
  • 53
  • 79
1
2 3 4 5 6 7 8