OpenStreetMap Forum

The Free Wiki World Map

You are not logged in.

#26 2011-10-28 17:27:17

Re: How to create map with coutours ?

A detailed description of TYP files and their underlying text files can be found in the cgpsmapper manual, and they can be compiled with cgpsmapper free.  AFAIK TYP files created with cgpsmapper work with mkgmap compiled IMG files.

Offline

#27 2011-10-28 19:36:28

Re: How to create map with coutours ?

miramikes wrote:

Is it possible convert txt and TYP there and back easily?
I would like to use polygon part which I already did with line and poit parts from other TYP file.
Doing copy/paste on txt file would be easy.

Yes, you can do it with typ viewer:
http://opheliat.free.fr/michel40/TYPViewer3.5/

Offline

#28 2011-10-31 20:44:23

Re: How to create map with coutours ?

ligfietser wrote:

Yes, you can do it with typ viewer:
http://opheliat.free.fr/michel40/TYPViewer3.5/

Thank you TYPViewer works fine for me.

ligfietser wrote:

Maybe use another source (Aster data) but I don't know how 'open' that data is.  If the map is only for your own use maybe they allow it to use.

As I am not still satisfied with contours (lot of holes in srtm for my area) I downloaded data from Aster (they are free for personal usage):

http://asterweb.jpl.nasa.gov/gdem-wist.asp

I got bunch of files ...

ASTGTM2_S50W068.zip  ASTGTM2_S50W068.zip.xml
ASTGTM2_S50W069.zip  ASTGTM2_S50W069.zip.xml
ASTGTM2_S50W070.zip  ASTGTM2_S50W070.zip.xml
and so on

each zip file contain tif files:
ASTGTM2_S50W068_dem.tif
ASTGTM2_S50W068_num.tif
README.pdf

Is it possible proceed them to obtain contours? Did I downloaded right data?

regards

mira

Offline

#29 2011-11-02 14:28:47

Re: How to create map with coutours ?

miramikes wrote:

As I am not still satisfied with contours (lot of holes in srtm for my area) I downloaded data from Aster (they are free for personal usage)
Is it possible proceed them to obtain contours?

I am now trying convert aster data to contour osm by modified perl script contour.pl which get here:
http://gis.638310.n2.nabble.com/contour … l#a5238778

Unfortunately having some java related problem (probably classpath):
Caused by: java.lang.ClassNotFoundException: Main
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Could not find the main class: Main. Program will exit.

maybe somebody here can help me fix this?

BTW: Is it possible to post attachment here? I would like to send here contour.pl script when I finish it.
Maybe someone here can help me tune it better.

regards

mira

Offline

#30 2011-11-16 00:42:51

Re: How to create map with coutours ?

Hi,

I just want to inform all who was following this thread that I succeeded to make contour from Aster v2 and Cgiar too.
Cgiar is the far best source of elevation data at the moment ( fixed all anomalies ).

I want to publish here perl script I did for data conversion, maybe they can be useful for someboby, maybe somebody can improve them.

---------------------------------------------------------------------------
Perl script for converting Aster dem.tif to hgt:

#!/usr/bin/perl -w

while (< *.tif>) {

  $tile = $_;
  $tile =~ s/_dem.tif//;
  $tile =~ s/ASTGTM2_//;
  $tile =~ m/([SN])(\d+)([EW])(\d+)/;

    `gdalwarp -of GTiff -srcnodata 32767  -rcs -order 3 -ts 1201 1201 -multi ASTGTM2_${tile}_dem.tif ${tile}.tif` ;

    `gdal_translate -of SRTMHGT ${tile}.tif ${tile}.hgt` ;

    `rm ${tile}.tif ${tile}.hgt.aux.xml` ;

}

----------------------------------------------------------------------
Perl script for converting cgiar 1 degree tiles to hgt:

#!/usr/bin/perl -w

while (< *.zip>) {
  $file_asc = $_;
  $file_asc=~ s/.zip//;

unless (-e "${file_asc}.asc") {`unzip  $_`};
      open(READ, "${file_asc}.asc" ) or  die $! ;
      @lines = <READ>;
      close (READ);

      $x = $lines[2];
      $y = $lines[3];

      $x =~ s/xllcorner     //;
      $y =~ s/yllcorner     //;

  if ($x > 0 ) {
      $lat = "N";
  } else {
      $lat = "S";
  }

  if ($y > 0 ) {
      $lon = "E";
  } else {
      $lon = "W";
  }

  $rx = sprintf("%.0f", $x);
  $ry = sprintf("%.0f", $y);

  $arx = abs $rx ;
  $ary = abs $ry ;

  $tile = "$lat" . "$ary" . "$lon" . "0" . "$arx" ;

    `gdalwarp -of GTiff -rcs -order 3 -ts 1201 1201 -multi ${file_asc}.asc ${tile}.tif` ;

    `gdal_translate -of SRTMHGT ${tile}.tif ${tile}.hgt` ;

#    `rm ${file_asc}.asc ` ;
    `rm ${tile}.tif ` ;
    `rm ${tile}.hgt.aux.xml ` ;

}

Offline

#31 2011-11-16 13:34:06

csdf
Senior Member
From: UK, living in Abu Dhabi
Registered: 2009-08-11
Posts: 314
Website

Re: How to create map with coutours ?

And have you then converted the HGT files to OSM?  If so, how?

Offline

#32 2011-11-18 02:44:05

Re: How to create map with coutours ?

csdf wrote:

And have you then converted the HGT files to OSM?  If so, how?

I am using Srtm2osm.exe program normally to make contours.osm

Srmt2osm.exe program download hgt files from server and store them in srtm/SrtmCache directory.
If these files are alredy in directory program use them instead of downloading them from server.

So I am just put "my_hgt" to  srtm/SrtmCache dir and rest workflow is same wink

mira

Offline

#33 2011-12-04 13:12:21

Re: How to create map with coutours ?

Hi,

while building my map I am getting a lot of errors like this:
SEVERE (RoadNetwork): 63240020.osm.gz: Road (ser, http://www.openstreetmap.org/browse/way/50972288) contains zero length arc at http://www.openstreetmap.org/?mlat=48.7 … 74&zoom=17

Is it fine to use "--remove-short-arcs" option for mkgmap?
I mean no broken route-ability? No missed details?

mira

Offline

#34 2011-12-04 13:53:37

Re: How to create map with coutours ?

Hi

I am building map of Scandinavia now.
Having hgt files from this excellent sites :
http://www.viewfinderpanoramas.org/dem3.html#scand

Problem is that when I build contour.osm file between N55  to  N73  and E3 to E33 degrees there are missing tiles in sea.
This cause minimal height -9999m and a lot of extra computing. (not finnished over night)
$ mono Srtm2Osm/Srtm2Osm.exe -large -step 20 -cat 400 200 -bounds1 55.00 3.00 73.00 33

Some workaround/rightworkflow for this?

Is somewhere Srtm2Osm.exe manual page with all possible options?

mira

Last edited by miramikes (2011-12-04 14:27:29)

Offline

Board footer

Powered by FluxBB 1.4.8
Hosting sponsored by Oxilion
Report abuse to osm at na1400 dot info