[Gdal-dev] Help a stupid GIS newbie: gdalwarp for GPSDrive maps

S Clark smc+gdal at dogphilosophy.net
Fri Sep 10 23:18:17 EDT 2004


On Friday 10 September 2004 08:50 pm, you wrote:
> [...]  We can figure out how to generate the map_koord.txt file once we
> figure out the projection stuff.  What units does the scale appear to use? 
> Is the scale number very small for "typical" maps?  If so, it's probably in
> degrees.  Otherwise my next guess would be meters.
I still don't "get" what the scale is - it's not EXACTLY 'meters/pixel' but it
seems to be related to that measure.  Here's the snippet of code from the
GPSDrive source that talks about what the map "scale" means:

/* Mapscale / pixelfact is meter / pixel */
#define PIXELFACT 2817.947378

I don't know how or why that 2817.947378 number comes in there, but
scale does at least relate to "meters/pixel". (GPSDrive's "scale" is
meters/pixel * 2817.947378....)

The map_koord.txt part is easy - I've already got code that generates lines
for that for the geographic-projection maps I'm generating from the NASA 
Blue Marble imagery and US Census Bureau Tiger/LINE data.  

> As far as your gdalwarp command line goes, you're missing the
> information that would be found in the world file; you need to create a
> file for your TerraServer source JPEG.  This file has the same root name
> as the image, with the extension .WLD or .JGW (either is OK).
>
> Are you retrieving the TerraServer images using the TerraServer
> "Download" service?  If so, you can download world files, too (see menu
> on the left, instructions below the image).  If you're retrieving the
> TerraServer image through some other interface, then you must be passing
> coordinates with that request and you can construct the world file from
> the parameters you're using.  Let us know how you're getting the source
> image, and we can at least complete the source image half of the
> equation.

When fetching from terraserver, I use an URL I found within Kismet's
map-generation code (The war-driving application Kismet includes a
program that can render network signal strength atop a map, so you
can check and/or interpolate the coverage of your wireless access
point...)

http://terraservice.net/GetImageArea.ashx?t=1&lat=$lat&lon=$lon&s=$scaleIdx&w=1280&h=1024

Where "t=1" specifies an aerial photo ("t=2" gives a USGS topo map), and
"$scaleIdx" is a number from, for some reason, 10 to 16:
10=2757
11=5512
12=11024
13=22048
14=44096
15=88182
16=176384
(the number on the right being what GPSDrive considers to be the resulting
1280x1024 image's "scale")

Does that help at all?



More information about the Gdal-dev mailing list