Questions tagged [maps]

A map is a visual representation of an area—a symbolic depiction highlighting relationships between elements of that space such as objects, regions, and themes. For the key-value data structure, use dictionary tag instead.

Modern maps

Many maps are static two-dimensional, geometrically accurate (or approximately accurate) representations of three-dimensional space, while others are dynamic or interactive, even three-dimensional.

Although most commonly used to depict geography, maps may represent any space, real or imagined, without regard to context or scale; e.g. brain mapping, DNA mapping, and extraterrestrial mapping.

Many, but not all, maps are drawn to a scale, expressed as a ratio such as 1:10,000, meaning that 1 of any unit of measurement on the map corresponds exactly, or approximately, to 10,000 of that same unit on the ground.

Maps of the world or large areas are often either 'political' or 'physical'. Topographic maps show elevations and relief with contour lines or shading. Geological maps show not only the physical surface, but characteristics of the underlying rock, fault lines, and subsurface structures.

Maps that depict the surface of the Earth also use a projection, a way of translating the three-dimensional real surface of the geoid to a two-dimensional picture. Perhaps the best-known world-map projection is the Mercator projection, originally designed as a form of nautical chart.

Aeroplane pilots use aeronautical charts based on a Lambert conformal conic projection, in which a cone is laid over the section of the earth to be mapped.

From the last quarter of the 20th century, the indispensable tool of the cartographer has been the computer. Much of cartography, especially at the data-gathering survey level, has been subsumed by Geographic Information Systems (GIS).

A complex problem when dealing with maps is to calculate the distance between two points. The simplest approach is to work as if the map was a simple plane and use Euclidean distance function. However, this might be inadequate, especially in the case when we are dealing with large distances. In that case the differences between the real shape of the planet and a plane will get more accent. A significant improvement over this is to calculate the distance between two coordinates using the Haversine formula, but even this might be imprecise in some cases where high precision is needed, due to the differences of altitude or other geometrical, or non-geometrical distance modificators, like speed limits on roads, closed borders of countries, travel costs, etc.

More info on Wikipedia

9449 questions
2
votes
1 answer

Create a type with the keys from a Map?

How can I create a type with the keys from a Map? export const languageOptionsMap = new Map([ [ 'cs', { value: 'cs', order: 1, text: 'Česky', }, ], [ …
user1283776
  • 19,640
  • 49
  • 136
  • 276
2
votes
1 answer

Groovy Code - Get the nth value from a list

Trying to print out the specific value from the following Map Map strokes = [1000:['M','?','?'], 100:['C','D','M'], 10:['X','L','C'], 1:['I','V','X']] In other words, if I have a value of 1234 I want it…
2
votes
1 answer

OSMBuilding with MapBox key

Looking at the example here: https://osmbuildings.org/examples/ In the JS section they define event for click: osmb.click(function(e) { var url = 'https://data.osmbuildings.org/0.2/uejws863/feature/'+ e.feature +'.json'; ajax(url,…
2
votes
1 answer

Cowplot Package: Aligning text labels in the top lefthand corner of plot space using plot_grid() in R

Overview: I have produced a series of maps (see below) using the R-code below, and I used plot_grid() in the Cowplot package to arrange the plots using the two data frames below called "QuercusRobur 1" and "QuercusRobur2". Problem: The plots look…
Alice Hobbs
  • 1,021
  • 1
  • 15
  • 31
2
votes
1 answer

Cowplot Package: How to align legends vertically downwards after arranging many plots into one plot using plot_grid() in R

Overview: I have produced a series of maps using the R-code below, and I used plot_grid() in the Cowplot package to arrange the plots onto one plot window using the data frames below called "QuercusRobur1" and "QuercusRobur2". The plots look…
Alice Hobbs
  • 1,021
  • 1
  • 15
  • 31
2
votes
2 answers

Create a polygon around each point in geojson from geojson

Creating a map similar to the one found here: https://www.plantmaps.com/interactive-california-2012-usda-plant-zone-hardiness-map.php Have all the data needed. Create polygons around each one without distance inbetween. No overlapping or…
sdoedos
  • 41
  • 11
2
votes
1 answer

how to create a world street map with r?

I want to create a world street map using Rstudio. I have this code: countries_map <-map_data("world") world_map<-ggplot() + geom_map(data = countries_map, map = countries_map,aes(x = long, y = lat, map_id = region, group = group), …
2
votes
1 answer

Changing the text in legend in ggplot map R Studio

I am trying to create a US map filled with heat level of flu diseases. I am having 2 issues: I couldn't change the variable text in the legend. The order of the legend is wrong. 1->10->2->... Here is the code. library(maps) library(ggplot2) # Get…
tcltan
  • 21
  • 1
  • 8
2
votes
0 answers

Google maps api - add alt attribute to close marker button

I am trying to pass my website for accessibility. However the google maps api does not have an alt attribute on the close icon. How can I add that? Thanks -O
MuhuPower
  • 404
  • 3
  • 25
2
votes
1 answer

Creating a map using struct members throws bad_alloc

So I have a struct struct float3 { float x, y, z; }; and I am trying to create a function to take the x,y,z values and map them to keys 0, 1, 2 for their respective dimension. I wrote the code below but it throws a bad alloc_exception. It…
p0ps1c1e
  • 176
  • 2
  • 2
  • 14
2
votes
1 answer

Make a map with a group of subregions with geom_sf

I want to make a map only with the external borders by groups of subregions. Bellow are plotted all the subregions and I want to make a map but only with the external borders of the regions which are in region column in the spain object. I have…
Tito Sanz
  • 1,280
  • 1
  • 16
  • 33
2
votes
2 answers

Why are the map's key value pairs being inverted when read into the forEach method?

I've only been learning javascript for a couple weeks and this is my first post so apologies if my question isn't very clear. I'm using the forEach method in Map's prototype to loop through a map of streets and their lengths. In the prototype of the…
moreLosty
  • 23
  • 4
2
votes
0 answers

How to wrap a tomtom map into a bootstrap container

So I have rendered the tomtom map into a bootstrap container as indicated below and everything seems to work fine as shown here HTML
Javascript code var map = tomtom.L.map('map', { …
2
votes
1 answer

Algorithm to find the 100 longest slopes on earth that are steeper than 30 degrees throughout?

This question is more conceptual as I do not have any code to show for it as of right now. However, I was wondering if I could get some help on how I could go about coding something like this without having the program take years to…
2
votes
1 answer

Interactive Bokeh Map

I'm using this code to make a interactive map on python: # Define the callback: update_plot def update_plot(attr, old, new): # Create a dropdown Select widget for the y data: y_select N = str(select.value) map_options =…
1 2 3
99
100