[OSM-talk] mkcntr2.pl: perl hackers wanted to fix contours....
simon at mungewell.org
simon at mungewell.org
Mon Aug 25 20:11:51 BST 2008
Perl looks like it might fly... I'll give it a go.
The raw data is available in sets, each covering only a portion of the
world. This page gives you a map of these:
http://srtm.csi.cgiar.org/SELECTION/inputCoord.asp
These files are huge, the one I downloaded covering around Blairmore, AB is:
---
166M srtm_14_03.ASC
48M srtm_14_03.ZIP
---
and the resultant contour.osm files are even worse..
No reason one couldn't provide a series of tiles to cover a wide area.
Simon.
> I've never coded in perl, but this seems to work :
>
> B.t.w. is there some way to do very large areas ? hunderds of
> thousands of km^2 ?
>
>
> print GNUPLOT "set terminal table
> unset surface
> set contour
> -set cntrparam level incremental 0, $l, 1000
> +set cntrparam level incremental 0, $l, 5000
> #set table 'tmp.cnt'
> set output 'tmp.cnt'
> #set terminal table 'tmp.cnt'
> @@ -85,7 +85,16 @@
> print "<nd ref='$prefix$s' />\n";
> }
> print "<tag k='contour' v='elevation' />\n";
> +if (int ($z / $ARGV[3]) * $ARGV[3] == $z) {
> + print "<tag k='contour_ext' v='elevation_major'\n";
> +}
> +else {
> + if (int ($z / $ARGV[2]) * $ARGV[2] == $z) {
> + print "<tag k='contour_ext' v='elevation_minor'\n";
> + }
> +}
> print "<tag k='ele' v='$z' />\n";
> print "<tag k='created_by' v='mkcntr2' />\n";
> print "</way>\n";
> return $id;
>
> On Mon, Aug 25, 2008 at 5:57 PM, <simon at mungewell.org> wrote:
>> ---------------------------- Original Message
>> ----------------------------
>> Subject: Re: [OSM-talk] mkcntr2.pl: perl hackers wanted to fix
>> contours....
>> From: simon at mungewell.org
>> Date: Mon, August 25, 2008 11:56 am
>> To: "Gora Mohanty" <gora at sarai.net>
>> --------------------------------------------------------------------------
>>
>> Hello Gora,
>> Thanks for the offer of help. Attached is a very small excerpt of
>> contours
>> from around the area where I'm mapping. I didn't want to do too much as
>> they generally come out with pretty huge files....
>>
>> --
>> $ du -ah *.osm
>> 184K contours.osm
>> 244M contours_10m.osm
>> 98M contours_25m.osm
>> 49M contours_50m.osm
>> --
>>
>> The excerpt give 10m contours, but you should be able to generate
>> whatever
>> you want from 'extract.txt'. If you need more data and don't want to
>> download the SRTM data for your/my area let me know and I'll cut out
>> another section.
>>
>> Regarding what the 'should' look like; I believe that in addition to
>> whats
>> in the example OSM file, there should be additional tags such as
>> 'contour_ext = elevation_major' for major multiples, along with
>> 'contour_ext = elevation_medium' and 'contour_ext = elevation_minor' for
>> the others.
>>
>> I think this would be along the line of...
>> --
>> <way id='1000005015' timestamp='0001-01-01T00:00:00'>
>> <nd ref='1000050442' />
>> <nd ref='1000050443' />
>> <nd ref='1000050444' />
>> <nd ref='1000050445' />
>> <tag k='contour' v='elevation' />
>> <tag k='ele' v='1200' />
>> <tag k='contour_ext' v='elevation_major' />
>> <tag k='created_by' v='mkcntr2' />
>> </way>
>> --
>>
>> Once it's coded I can 'spin' a map and tell you whether this is correct.
>>
>> Thanks,
>> Simon.
>>
>> PS. There is a 1000m ceiling by default, most of my area is above that
>> which means that you don't get many contours....
>>
>>
>>
>>
>> _______________________________________________
>> talk mailing list
>> talk at openstreetmap.org
>> http://lists.openstreetmap.org/listinfo/talk
>>
>
More information about the talk
mailing list