map

Google maps - encoding individual waypoints

I am trying to build up a string which will link directly to the Google maps print view. e.g. http://maps.google.co.uk/maps?f=d&source=s_d&saddr=brixton&daddr=bath+to:bournemouth&hl=en&geocode=FUQ7EQMdyDr-_ym5RCh-QQR2SDGm1XOO93zFHA%3BFbQEEAMdMgfc_ykt4T50pnhxSDEJmm3W0CeLEw%3B&mra=ls&sll=51.75764,-1.241455&...

How to create a map function in c++?

Say there is a list of integers [1,2,3,4,5] and a map function that multiplies each element with 10 and returns modified list as [10,20,30,40,50] , with out modifying the original list. How this can be done efficiently in c++. ...

Using python's map() with multiple args?

Okay, so I've got a piece of Python code which really needs optimizing. I need to iterate over every single pixel of a small (80x60) image and extract the RGB values from it. The code in the loop itself isn't too slow, but I'm doing it using nested for loops, which I assume add quite a bit of overhead... xr = xrange(80) yr = xrange(60)...

Easy way to get the keys in a map in alphabetical order

In Go, what's the easiest way to get the keys in a map sorted alphabetically? This is the shortest way I can do it: package main import "container/vector" import "fmt" import "sort" func main() { m := map[string]string {"b":"15", "z":"123123", "x":"sdf", "a":"12"} var keys vector.StringVector; for k,_ := range ( m ) { ...

Use Maps application in my Android application.

Hello. I am currently developing an application which has a maps feature. My map is working, but I still need to create a Directions option. In previous versions of the Android SDK there used to be a class called DrivingDirections, which did exactly what I want. Now it's gone and I don't know how to add this feature to my current map. I ...

iphone map fold button in new map app

Hello, does anyone know what is the name of the button in the right corner of the toolbar in the new Maps application? It's the button that unfolds the map and the view underneath offers buttons to switch between map modes. I would like to use it in my map application if it's a part of the SDK! ...

How to test key existence in a map?

I know I can iterate over a map m by, for k, v := range m { ... } and look for a key but is there a more efficient way of testing a key's existence in a map? Thanks. I couldn't find an answer in the language spec. ...

How to set a class of my creation to be a key in a TreeMap (Java)

I created a class DateTime (which wraps GregorianCalendar). I also created a class Event. I would like to create a collection of events from which I can retrieve an event by its date. For instance: event is of type Event; date1 and date2 are of type DateTime and also date1.equals(date2); 'events' is my event collection. event.put(date1,...

iphone quartz draw border around line

Hello, what's the best way to draw a (black) border around a line in quartz for iphone? I'm drawing lines on streets on map and if the line is yellow (which is a legit use case), it blends in with the street color. One thing I could do is lay my lines over a little thicker black line, but this doesn't sound very efficient. ...

Google App Engine Geohashing

I am writing a web application using GWT and App Engine. My application will need to post and query items based on their latitude, longitude. As a result of google's distributed database design you can't simple query a set of inequalities. Instead they suggest doing geohashing. The method is described on this page. http://code.goo...

Key repeats and ranges in Vim mappings

I want to define a mapping in my .gvimrc such that if the last key pressed is held, the triggered action is repeated. Specifically, I want to do something like map <SPACE>t :set transparency-=1 map <SPACE>T :set transparency+=1 for MacVim, but I want the transparency to continue to be decreased/increased when t/T are held (don't want ...

A crowdsourced Map Edit application for enviornmental cause

I want to create an application where users can mark on map location of polluting factories. Google map provides a MAP editor feature. We would like to have our own website like www.toxic-map.org where people could mark these locations. What would be the best approach for this? Additionally we should be able to backup this database whic...

Understanding Linker Map File (MS Visual Studio 2005)

All - I'm trying to understand the first section of the Map file produced by the MS Visual Studio 2005 linker. I know it has something to do with memory sections, but can someone help me decipher it? Timestamp is 4b4f8d2b (Thu Jan 14 14:31:23 2010) Preferred load address is 00400000 Start Length Name C...

GIS, Mercator projection, calculate Y position

I am doing some stuff with GIS(or map), and I know how to calculate Y position from latitude in mercator projection. But I don't know how it comes? Why it is ln(tan(x)+sec(x)) ? I couldn't figure out why there is a 'ln'? I know it is not directly related to programming, but I hope some one could help me understanding about this (bett...

C++ problem in calling a function in main that prints the map.

Hi, I am trying to print the contents of the map and this is where my code fails. I have tested all my methods and I have no problem to read from file, filer the word, put it into map, and even the print function is working. However, when I am calling the printer function from main it does not print the map. I am new to polymorphism and...

Why does this flood-fill algorithm cause a stack overflow?

void FloodFill(int layer, int x, int y, int target, int replacement) { if (x < 0) return; if (y < 0) return; if (x >= _mapWidth) return; if (y >= _mapHeight) return; if (_mapLayers[layer, x, y] != target) return; _mapLayers[layer, x, y] = replacement; FloodFill(layer, x - 1, y, target, replacement); Flo...

Why am I getting unexpected results from chained calls to map?

I'm using Getopt::Lucid to process CLO and I've run into an interesting and unexpected problem. The following code: push @clo_spec, map { Switch($_) } qw(-c -m -s -p), map { Switch($_) } qw(--help --man --usage --version), map { Switch($_) } qw(--debug --verbose), map { Param($_) } keys ...

Categorize a list of lists by 1 element in python

An example list of lists: [ ["url","name","date","category"] ["hello","world","2010","one category"] ["foo","bar","2010","another category"] ["asdfasdf","adfasdf","2010","one category"] ["qwer","req","2010","another category"] ] What I wish do to is create a dictionary -> category : [ list of entries ]. The resultant dictionary would...

How to create array-like data-structures with object keys in PHP?

I want create arrays with object keys in PHP, i.e. something like this: <?php $keyObject = new KeyObject; $valueObject = new ValueObject; $hash = array($keyObject => $valueObject); However, this raises an error. Arrays may only have integer or string keys. I end up having to do something like: $hash = array( 'key' => $keyO...

Way to tell if a map tile image has loaded successfully using OpenLayers

Using OpenLayers, is there an easy way to tell if a map image has loaded correctly, perhaps using the “loadend” event? We are reading map tiles from GeoServer, and using OpenLayers to display them. Most of the time, the image displays in a reasonable time. Occasionally (especially when scrolling back and forth using the mouse wheel), ...