maps

Snapshot from the map in android

☆樱花仙子☆ 提交于 2019-12-04 21:44:27
I want to make a snapshot of a particular location from the map by calling intent or from a mapview.Can anyone help me.I am not getting the snapshot. Try this post, I believe this should help. It involves enabling the drawing cache and forcing it use that cache. Usually works on all views. Should work on MapView aswell Code from the link private Bitmap getMapImage() { /* Position map for output */ MapController mc = mapView.getController(); mc.setCenter(SOME_POINT); mc.setZoom(16); /* Capture drawing cache as bitmap */ mapView.setDrawingCacheEnabled(true); Bitmap bmp = Bitmap.createBitmap

Drawing maps without margins in R

∥☆過路亽.° 提交于 2019-12-04 21:06:57
问题 I'm trying to get rid of the margins of maps generated using the 'maps' package in R. I get some of the way there by setting par(mar=c(0,0,0,0)) and using the option border=0 in the map() function. But compared to e.g. a scatterplot with mar=c(0,0,0,0) there's still a lot of extra space. Here's some code to generate an example map, as well as a regular scatterplot for comparison. library(maps) x <- sample(360, 10)-180 y <- sample(160, 10)-80 x.boundary <- c(-180, 180, 0, 0) y.boundary <- c(0,

How to sort both key and value in a multimap?

眉间皱痕 提交于 2019-12-04 20:31:28
Suggest any method to sort a multimap for both key and its values. For example- Input- (5,1), (1,9), (1,1), (5,2), (1,2) And the Output must be- (1,1), (1,2), (1,9), (5,1), (5,2). The answer is emplace_hint. Pseudo code will look like that:- insert_with_hint(M mmap, K key, V Value) { auto i1 = mmap.equal_range(Key); for (auto i2 = i1.first; i2 != i1.second; ++i2) { if (i2->second > Key) { // <-- Here add your sorting criteria mmap.emplace_hint(i2,Key,Value) return } } mmap.emplace(Key,Value) } You just need to copy all its elements to a multiset<pair<int, int>> : multimap<int, int> a; a.insert

Avoiding hoizontal lines and crazy shapes when plotting maps in ggplot2

為{幸葍}努か 提交于 2019-12-04 20:28:53
问题 I want a plot of an area, such as Latin America, using the world shape file from IPUMSI... https://international.ipums.org/international/resources/gis/IPUMSI_world.zip ... I will add some more IPUMS districts later so I really want to use this as my template layer. I having difficulty with the plot when I add limits through coord_map in ggplot2. The initial spatial file looks alright library("ggplot2") library("raster") sd0 <- readShapePoly("./IPUMSI_world.shp") df0 <- fortify(sd0) ggplot

Android Polyline - Adding point by point

ぐ巨炮叔叔 提交于 2019-12-04 20:07:46
问题 I'm currently having a map, and each 10 meters I use LocationListener to refresh my location and get the new Latitude and Longitude. Now I wish that the route the user is taking will be displayed with a red line. So everytime the OnLocationChange() from LocationListener class is called, I want to update the map with a line between the last location and the new location. So far I've added the following: private void initializeDraw() { lineOptions = new PolylineOptions().width(5).color(Color

How to get the values from the Hashmap without using Iterator?

徘徊边缘 提交于 2019-12-04 19:58:42
Iterator iterator = map.entrySet().iterator(); while (iterator.hasNext()) { Map.Entry mapEntry = (Map.Entry) iterator.next(); System.out.println("The key is: " + mapEntry.getKey() + ",value is :" + mapEntry.getValue()); } This is my code. Now i don't want to use Iterator to get the values. Please help me to find best solution. Map<String, Object> map = .....;//Initialization here for (String key : map.keySet()) { // write your code here } //If you are just using keys of the Map for (Object value : map.values()) { // write your code here } //If you are just using values from your Map for (Map

plotting multiple maps using rworldmap library

人走茶凉 提交于 2019-12-04 19:37:13
I want to plot multiple maps using rworldmap, where each column is a separate month and the rows are years. I know this can be done in ggmap using facet_grid. How can I do this using rworldmap? For example, the mydata file contains columns for the latitude , longitude , month and year of each point. My code so far: library(rworldmap) newmap <- getMap(resolution = "high") plot(newmap, xlim = c(110, 155), ylim = c(-35, -20), asp = 1) p1 <- read.csv("mydata.csv") points(p1$lon, p1$lat, col = "red", cex = .5) To plot multiple maps using rworldmap, you could use layout and a couple of loops to

How to get a layer from a feature in Openlayers 3?

老子叫甜甜 提交于 2019-12-04 18:32:06
问题 I can't find a way to go from a feature in a selection event to a layer that it may be a part of without traversing all the features of all my map layers, or storing an artificial layer ID within every feature at creation. Is this just not possible yet? ol.js 3.7.0 ol.interaction.Selection -> click -> callback( event ){ event.selected[0] } In another part of my app, I would like to go from the feature to the layer to determine the style being used on the feature, specifically whether or not

ios custom maps, geolocation, mapping and more

落花浮王杯 提交于 2019-12-04 17:45:14
The next image was taken from www.Trimaps.com (I hope it's allowed to use images here, if not, please tell me and i'll remove it immediately). These images explain perfectly what i'm trying to accomplish. I have all the data one would need: Latitude/Longitude (in decimal values) of 4 corners of the desired area (from Google Maps). A beautiful custom image of a mountain (similar to the right image). All i need is the math. I've tried all the formula's, scaling/ transfomations, you name it. I'm sure it's possible as it depends on pure MATH, relatively simple math equations. www.Trimaps.com

Plot GeoIP data on a World Map

随声附和 提交于 2019-12-04 17:42:11
问题 I need a library (preferably written in Python) which is able to take a series of IP addresses (or geographic coordinates) and plots them on a World Map. I already found this one, but it outputs data as a .svg file and it's simply unable to cope with large data sets. Please note that I need something which can be downloaded and run locally, so no data uploading to 3rd party web services. Thanks! 回答1: Perhaps Basemap in Matplotlib for the plotting. It can do all sorts of projections (don't