maps

How can I color the ocean blue in a map of the US?

无人久伴 提交于 2019-11-29 06:19:54
I would like to draw a map of the US over an image, but then fill in the oceans. here is my starting point: library(maps) library(graphics) image(x=-90:-75, y = 25:40, z = outer(1:15, 1:15, "+"), xlab = "lon", ylab = "lat") map("state", add = TRUE) But I would like the Atlantic Ocean and Gulf of Mexico to be filled in a solid color. Good question! How's this? library(maps) image(x=-90:-75, y = 25:40, z = outer(1:15, 1:15, "+"), xlab = "lon", ylab = "lat") map("state", add = TRUE) library(grid) outline <- map("usa", plot=FALSE) # returns a list of x/y coords xrange <- range(outline$x, na.rm

What is the Big O performance of maps in golang?

元气小坏坏 提交于 2019-11-29 05:35:58
The "Map types" section of the go language specification describes the interface and general usage of map types and the "Go maps in action" post on The Go Blog casually mentions hash tables and "fast lookups, adds, and deletes". The current runtime/hashmap.go source code describes its implementation as a hashtable (which are typically amortized O(1) ); however, I don't see any guarantee of performance characteristics (such as Big O performance) in the language specification or other materials. Does the go language make any performance guarantees (e.g. constant-time insertion/lookup/deletion?)

Transparency and Alpha levels for ggplot2 stat_density2d with maps and layers in R

橙三吉。 提交于 2019-11-29 04:06:47
Can anyone offer suggestions as to the best way to deal with transparency and alpha levels with many layers (with reference to ggplot2 )? In the sample code below, it becomes very difficult to see individual state borderlines (e.g. South Carolina, North Carolina, Virginia) -- I have tried setting alpha=0.00001 but this appears to make things worse... library(ggplot2) all_states = map_data("state") set.seed(103) df = data.frame(long=sample(-90:-70,100,T), lat=sample(30:45,100,T)) p = ggplot() + geom_polygon(data=all_states, aes(x=long, y=lat, group=group), color="white", fill="grey80") + stat

GADM-Maps cross-country comparison graphics

旧巷老猫 提交于 2019-11-29 03:58:59
Maybe due to the fact I'm relatively new to R, I have problems using the gadm-Mapfiles on http://www.gadm.org/ . I try to draw a map with several countries and compare them to each other (using different colors). This is what I do library('sp') ## load(url('http://biogeo.ucdavis.edu/data/gadm2/R/ARG_adm0.RData')) # loads an Object "gadm" with shape of Argentinia arg <- gadm # is there a more convenient way to do this in one line? load(url('http://biogeo.ucdavis.edu/data/gadm2/R/CHL_adm0.RData')) # loads an Object "gadm" with shape of Chile chl <-gadm load(url('http://biogeo.ucdavis.edu/data

3D maps library for android

巧了我就是萌 提交于 2019-11-29 03:51:09
Does anybody know any free of charge android maps library that has 3D capabilities? I know for sure that google maps doesn't support 3d when using the sdk library. The provider is not a problem. I'm not married with google maps, nor any other. The following are apps that can be used as example of what i'm trying to accomplish. Waze https://play.google.com/store/apps/details?id=com.waze Route 66 https://play.google.com/store/apps/details?id=com.route66.maps5 Example I want to mention this solution: http://www.eegeo.com It is crossplatform service with 3D modelling, routes tracking, traffic

Finding the lat-long of the corners in a Google Maps window

£可爱£侵袭症+ 提交于 2019-11-29 03:33:24
Using the Google Maps API, how can I get the latitude and longitude of the corners of the map display area? That is, if my map is 300px wide and 400px tall, how can I find the lat-long of the points at (0,0) and (300,400)? Derek Swingley Use getBounds() . From the doc: Returns the the visible rectangular region of the map view in geographical coordinates. That function returns exactly what you want: the southwest and northeast corners of your map. The first pair of coordinates are the lower left (southwest) coordinates and the second pair is the upper right (northeast) coordinates. 来源: https:/

How can I get latitude, longitude from x, y on a Mercator map (JPEG)?

六月ゝ 毕业季﹏ 提交于 2019-11-29 03:07:47
问题 I have a Mercator projection map as a JPEG and I would like to know how to relate a given x, y coordinate to its latitude and longitude. I've looked at the Gudermannian function but I honestly don't understand how to take that function and apply it. Namely, what input is it expecting? The implementation I found (JavaScript) seems to take a range between -PI and PI, but what's the correlation between my y-value in pixels and that range? Also, I found this function which takes a latitude and

ggplot US state map; colors are fine, polygons jagged - r

送分小仙女□ 提交于 2019-11-29 02:27:50
I'm trying to plot a US map where each state is shaded by the count that it has. I've gotten the shading to work just fine. The problem I'm running into, however, is that the polygons look very jagged (I'm assuming something happened when I tried to merge the map_data('state') with my data frame of counts per state). My data frame before merging has 49 rows (Nevada was missing data in my set), and after merging has many more rows (expected for the long/lat items for the states) but the data appears to be copied correctly for each lat/long pair, so I'm unsure why the poly's are so jagged. Code:

A MapKit for Mac OS X?

主宰稳场 提交于 2019-11-29 02:26:41
问题 on the iPhone we have the Apple's amazing MapKit. There is something similar for Mac OS X? If possible something more advanced than a simple WebView, because I need that it manage automatically at least: annotations the user interaction the zoom in/out an overlay view (Even if the maps are not from Google is ok.) Thank you very much! 回答1: Update 2 MapKit is available in OS X 10.9 Mavericks : Map Kit Framework Reference. Update - pulled from my comment below The situation has changed and there

R map switzerland according to NPA (locality)

半世苍凉 提交于 2019-11-29 02:18:13
I plan to do a survey in Switzerland. NPA will be asked. NPA (postal codes) contains 4 number. For instance 1227 is the NPA of Carouge (part of canton Geneva - Switzerland). For instance 1784 is the NPA of Courtepin (part of canton Fribourg -Switzerland). etc. I would like to know how to represent all observation (about 1500) on a map. I was thinking using ggplot as I use it for other graphs (I think ggplot is "beautiful"). However, I'm open to any other suggestion. Here are some fake data: http://pastebin.com/HsuQnLP3 The output for the swiss map should be a bit like that USA map (credit: