No srtm.obf file or documentation to build srtm.obf file for Greece, Germany and etc.

306 views
Skip to first unread message

sam

unread,
Oct 29, 2011, 11:35:48 AM10/29/11
to Osmand
I have started the issue at
http://code.google.com/p/osmand/issues/detail?id=703

Because I need more countries, in particular Greece, because soon I'm
out there by bike.

Thank you

andre van atten

unread,
Oct 29, 2011, 12:19:56 PM10/29/11
to osm...@googlegroups.com

Hi,

keep it simple. Use cyclemap, and predownload the tiles on your phone.

Andre

Op 29 okt. 2011 17:35 schreef "sam" <sams...@gmx.at> het volgende:

Yves

unread,
Oct 30, 2011, 4:12:47 AM10/30/11
to osm...@googlegroups.com
That's just a work around.
http://www.openstreetmap.org/user/!i!/diary/15190
Yves
--
Envoyé de mon téléphone Android avec K-9 Mail. Excusez la brièveté.


andre van atten <andrev...@gmail.com> a écrit :

szimszon

unread,
Oct 30, 2011, 6:12:29 AM10/30/11
to osm...@googlegroups.com
You could follow:

http://code.google.com/p/osmand/issues/detail?id=447

but you don't need to patch rendering_types.xml just have the recent OsmAndMapCreator (http://download.osmand.net/latest-night-build/)
or add additional file to OsmAnd just the recent version should work (http://download.osmand.net/latest-night-build/).

Basically you need srtm data converted to .osm (http://wiki.openstreetmap.org/wiki/Srtm2Osm)
You would beed .Net 2.0 or Mono on Linux.

If you have the .osm data you just need to feed it to OsmAndMapCreator just like any other OpenStreetMap data.
Copy the created .obf to sdcard  and enjoy to result.

andre van atten

unread,
Oct 30, 2011, 5:42:07 PM10/30/11
to osm...@googlegroups.com

Well,

I have to say: your timing couldn't be better. A few minutes later and !I! explained what you meant to say.

Nice name btw, !I!I!I!I!I!I!

Andre

Op 30 okt. 2011 09:12 schreef "Yves" <yve...@gmail.com> het volgende:

yvecai

unread,
Oct 31, 2011, 11:03:07 AM10/31/11
to osm...@googlegroups.com
Yes I've just seen his mail on Osm list.
I'll have a look at contour lines. I have them working WW on mapnik on my server, and I think I can create files by country. To bad I can't simply extract them from mapnik db!
Keep in touch!

Yves

yvecai

unread,
Nov 1, 2011, 2:28:24 PM11/1/11
to osm...@googlegroups.com
I extarctedthe swisscontour lines with Srtm2Osm, but it seems to have duplicate node ids?
I checks the ways ids, they are ok. Anyway, I just have contours above ~1000m or so, the lower one are missing. Somebody experienced that?
My Osm file is not sorted, could this matters?

Yves

Here is an extract of OsmAndMapCreator output:

Done 63.288 %.
31 oct. 2011 21:26:47 net.osmand.data.preparation.OsmDbCreator acceptEntityToLoad
GRAVE: Could not save in db
java.sql.SQLException: columns id, ord are not unique
    at org.sqlite.DB.throwex(DB.java:370)
    at org.sqlite.DB.executeBatch(DB.java:302)
    at org.sqlite.PrepStmt.executeBatch(PrepStmt.java:93)
    at net.osmand.data.preparation.OsmDbCreator.acceptEntityToLoad(OsmDbCreator.java:216)
    at net.osmand.osm.io.OsmBaseStorage.acceptEntityToLoad(OsmBaseStorage.java:271)
    at net.osmand.osm.io.OsmBaseStorage.endElement(OsmBaseStorage.java:251)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:604)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1759)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2915)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:625)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:488)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:812)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:741)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1208)
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:525)
    at javax.xml.parsers.SAXParser.parse(SAXParser.java:392)
    at javax.xml.parsers.SAXParser.parse(SAXParser.java:195)
    at net.osmand.osm.io.OsmBaseStorage.parseOSM(OsmBaseStorage.java:103)
    at net.osmand.data.preparation.IndexCreator.extractOsmToNodesDB(IndexCreator.java:271)
    at net.osmand.data.preparation.IndexCreator.createPlainOsmDb(IndexCreator.java:303)
    at net.osmand.data.preparation.IndexCreator.generateIndexes(IndexCreator.java:394)
    at net.osmand.data.index.IndexBatchCreator.generateIndex(IndexBatchCreator.java:528)
    at net.osmand.data.index.IndexBatchCreator.generatedIndexes(IndexBatchCreator.java:482)
    at net.osmand.data.index.IndexBatchCreator.runBatch(IndexBatchCreator.java:345)
    at net.osmand.data.index.IndexBatchCreator.runBatch(IndexBatchCreator.java:263)
    at net.osmand.data.index.IndexBatchCreator.main(IndexBatchCreator.java:140)
31 oct. 2011 21:26:52 net.osmand.data.preparation.OsmDbCreator acceptEntityToLoad
GRAVE: Could not save in db
java.sql.SQLException: columns id, ord are not unique
    at org.sqlite.DB.throwex(DB.java:370)
    at org.sqlite.DB.executeBatch(DB.java:302)

andre van atten

unread,
Nov 1, 2011, 2:39:07 PM11/1/11
to osm...@googlegroups.com

Hi,

I didn't notice that. Maybe you can check it in the source OSM data. Convert it to db and query it?
Or check a smaller region. I did Netherlands, easy;-) nearly no height, so very few contourlines, but I also got lines around 0 meters and below sealevel. Yeah!
So Maybe Switzerland is all about 1000m or higher?

Andre

Op 1 nov. 2011 19:28 schreef "yvecai" <yve...@gmail.com> het volgende:

yvecai

unread,
Nov 1, 2011, 3:00:22 PM11/1/11
to osm...@googlegroups.com
Switzerland is higher than Netherland, but the Geneva lake altitude is abound 400m. Clearly, some contours are missing.
Unfortunately, I'm no good with DBs, but I extracted the node ids with grep, then count them with python:
>>> len(ids)
22951508
But if I remove duplicates:
>>> len(set(ids))
2441396
The ways are OK. I used the -large option of Srtm2Osm, it's maybe that.

Yves

Victor Shcherb

unread,
Nov 1, 2011, 6:35:13 PM11/1/11
to osm...@googlegroups.com
As I see from exception probably some way ids are duplicated what is the most strange they are duplicated pairly with node id :) Something like 2 same way appears in the file.

Probably try to clean up your workspace, remove nodes.tmp.odb .....

Victor

2011/11/1 yvecai <yve...@gmail.com>

yvecai

unread,
Nov 2, 2011, 6:02:16 PM11/2/11
to osm...@googlegroups.com
I thought it was coming from the fact that Srtm2Osm with the large option write sequentially nodes, then way, then nodes, then another way... in the output .osm file, but no cigar.
I managed painfully to sort them (it's a 3.5GB file for Switzerland).
Now, I don't have any error any more with OsmAndMapCreator, and after removing nodes.tmp.odb I still don't have contour lines below
1150 m (I have at least up to3800 m).
I can say that all the ways' id are uniques, and all the nodes' id too, there is 1138099 ways and 37592976 nodes.

My last try was:
bbox=$(./poly2bb.pl switzerland.poly)
echo bbox=$bbox
Srtm2Osm/./Srtm2Osm.exe -large -step 20 -bounds1 $bbox -o out.osm
# Sort nodes, then ways, Osmosis can't do this alone on such a large file:
cat out.osm | ./osmfilter32 --drop-nodes > ways.osm
cat out.osm | ./osmfilter32 --drop-ways > nodes.osm
sed -e '1,2d' ways.osm > ways.tmp
head -n -2 nodes.osm > nodes.tmp
cat nodes.tmp ways.tmp > sorted.osm

osmosis-0.35/bin/./osmosis --read-xml-0.5 enableDateParsing=no sorted.osm --migrate --sort --wx sorted_twice.osm
osmosis --read-xml enableDateParsing=no sorted_twice.osm --bp file=switzerland.poly --wx ch.osm

Yves

yvecai

unread,
Nov 3, 2011, 5:05:36 PM11/3/11
to osm...@googlegroups.com
Oh ... my mistake Srtm2Osm creates duplicate nodes ids on such a large extract. Not very handy ...


On 01. 11. 11 23:35, Victor Shcherb wrote:

yvecai

unread,
Nov 5, 2011, 6:06:19 AM11/5/11
to osm...@googlegroups.com
Bad of me. No there is not. I should focus a little.
$grep '<node' out.osm | grep -o '"[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]"' >nodeid.txt
$sort -u nodeid.txt > nodesorted.txt
$ wc -l nodeid.txt
37592977 nodeid.txt
$ wc -l nodesorted.txt
37592977 nodesorted.txt

Yves

yvecai

unread,
Nov 6, 2011, 5:46:03 AM11/6/11
to osm...@googlegroups.com
Keep on moving...

I now have a script that:
1) extract a bounding baox from a country.poly file
2) calls Srtm2Osm to build contour in small tiles of 0.25x0.25 degrees
This step is needed to reduce contour lines length and allow easy preprocessing
2) preprocess the files to give all the elements a unique id, additiionnally add a tag 'name=*' to contour line where elevation is modulo 100m to render the altitude on those lines.
3) Assemble all the small osm file to give them to OSmAndMapCreator

This works well on Switzerland at least.

No, to go further, I need to cut out the osm file along the switzerland.poly file. However, both osmosis and osmconvert does not cut the contour lines that closes (ie. polygons) across the border, leading to nasty artifacts.
Any idea?

Yves

On 01. 11. 11 23:35, Victor Shcherb wrote:

andre van atten

unread,
Nov 6, 2011, 6:09:51 AM11/6/11
to osm...@googlegroups.com
Hi Yves,

You really are a scriting guru! So if you can't handle those nasty border atrefacts, who should ??
You might try QGis. It has plugins to load OSM files, but I dont know if it is restricted to standard osm tags? It is more a GIS system, so it could have the tools you need. I am not sure if it works in your case, but it is worth a try. 

Andre

2011/11/6 yvecai <yve...@gmail.com>

yvecai

unread,
Nov 6, 2011, 9:13:05 AM11/6/11
to osm...@googlegroups.com
On 06. 11. 11 12:09, andre van atten wrote:
> Hi Yves,
>
> You really are a scriting guru! So if you can't handle those nasty
> border atrefacts, who should ??
>
Hmm, somebody else? :)

yvecai

unread,
Nov 8, 2011, 3:59:27 PM11/8/11
to osm...@googlegroups.com
Hi all, it's working

On this page [1] you will find the result of the chain that is working on my server right now.
I just have to drop a polygon from geofabrik file in a directory, run the script, and let the server do his job.
The scripts are available in the same directory, they use Srtm2Osm, Osmconvert and OsmAndMapCreator, along with ugly system calls from python.
The files can be transfered to another server with storage space, does google-code server have some?

The good thing is that it is half-manual, so you can ask me for an extract!
I'll try to check what are the most demanded maps on Osmand server to know whart should be done first.
Yves
[1] http://www.pistes-nordiques.org/osmand-page/Osmand-SRTM-contours/


On 06. 11. 11 12:09, andre van atten wrote:

David White

unread,
Nov 8, 2011, 4:22:03 PM11/8/11
to osm...@googlegroups.com

Super Yves!

Now how can us lamda users play with the new toy? I just downloaded Nord pas de calais but can't figure out howto display anything :-(

A++

David White
Openstreetmap DavidKW
sent on Galaxy S, please excuse brevity

David White

unread,
Nov 8, 2011, 4:25:15 PM11/8/11
to osm...@googlegroups.com

Aha: poi > cache geographique and zoom 14 and above!

Victor Shcherb

unread,
Nov 11, 2011, 7:34:18 AM11/11/11
to osm...@googlegroups.com
Hi 
Thanks for you work!!!
Why you didn't put map into zips ;)
I put your scripts to https://github.com/osmandapp/Osmand/tree/master/config to share your efforts. Let me know if you have any concerns


Victor

2011/11/8 David White <dgkw...@gmail.com>

yvecai

unread,
Nov 11, 2011, 7:59:12 AM11/11/11
to osm...@googlegroups.com
You're welcome, I'll let you know when I have final scripts (they still have rough edges) and a proper README.

Yves

Shorty66

unread,
Nov 11, 2011, 6:00:02 PM11/11/11
to Osmand
I would love to have conturlines for the whole alps and germany.
Could you please do that?

On 11 Nov., 13:59, yvecai <yve...@gmail.com> wrote:
> You're welcome, I'll let you know when I have final scripts (they still
> have rough edges) and a proper README.
>
> Yves
>
> On 11. 11. 11 13:34, Victor Shcherb wrote:
>
>
>
>
>
>
>
> > Hi
> > Thanks for you work!!!
> > Why you didn't put map into zips ;)
> > I put your scripts to
> >https://github.com/osmandapp/Osmand/tree/master/configto share your
> > efforts. Let me know if you have any concerns
>
> > Victor
>
> > 2011/11/8 David White <dgkwh...@gmail.com <mailto:dgkwh...@gmail.com>>

yvecai

unread,
Nov 12, 2011, 4:28:01 AM11/12/11
to osm...@googlegroups.com
Germany is already there.
For Alps, France Rhone-Alpes is done, I launched Austria and Switzerland
today, along with whole Italy. I'm not sure that Italy will work, it is
maybe too big, we'll see.

Yves

howo

unread,
Nov 12, 2011, 11:59:56 AM11/12/11
to Osmand
Yves - really great your contribution and a big step forward!

Just one hint towards an improvement: the official STRM data of the
Alps (and other mountain regions) are full of artefacts and voids that
really hamper the outdoor use there. There are better and void-
correted data available at www.viewfinderpanorama.org from these
regions . Their implementation is straightforward - just replace the
official NASA data in the SrtmCache folder before running Srtm2Osm.
Srtm2Osm will not download data that arer already there.
(www.viewfinderpanorama.org wants to be acknowledged or asked!)

Wolfgang




On 12 Nov., 10:28, yvecai <yve...@gmail.com> wrote:
> Germany is already there.
> For Alps, France Rhone-Alpes is done, I launched Austria and Switzerland
> today, along with whole Italy. I'm not sure that Italy will work, it is
> maybe too big, we'll see.
>
> Yves
>
> On 12. 11. 11 00:00, Shorty66 wrote:
>
>
>
> > I would love to have conturlines for the whole alps and germany.
> > Could you please do that?
>
> > On 11 Nov., 13:59, yvecai<yve...@gmail.com>  wrote:
> >> You're welcome, I'll let you know when I have final scripts (they still
> >> have rough edges) and a proper README.
>
> >> Yves
>
> >> On 11. 11. 11 13:34, Victor Shcherb wrote:
>
> >>> Hi
> >>> Thanks for you work!!!
> >>> Why you didn't put map into zips ;)
> >>> I put your scripts to
> >>>https://github.com/osmandapp/Osmand/tree/master/configtoshare your
> >>> efforts. Let me know if you have any concerns
> >>> Victor
> >>> 2011/11/8 David White<dgkwh...@gmail.com<mailto:dgkwh...@gmail.com>>
> >>>      Aha: poi>  cache geographique and zoom 14 and above!
> >>>      David White
> >>>      Openstreetmap DavidKW
> >>>      sent on Galaxy S, please excuse brevity- Zitierten Text ausblenden -
>
> - Zitierten Text anzeigen -

Yves

unread,
Nov 12, 2011, 1:54:07 PM11/12/11
to osm...@googlegroups.com
Unfortunately, AFAIK there is no DEM with a proper license apart srtm.

Yves
--
Envoyé de mon téléphone Android avec K-9 Mail. Excusez la brièveté.


howo <wolfgang...@googlemail.com> a écrit :

yvecai

unread,
Nov 13, 2011, 12:57:00 PM11/13/11
to osm...@googlegroups.com
For zips, I'm not sure it's practical to unzip them if they are downloaded from a phone.
We can do that if the files are available directly from OsmAnd, like the other extracts.


Yves

On 11. 11. 11 13:34, Victor Shcherb wrote:

andre van atten

unread,
Nov 13, 2011, 1:14:41 PM11/13/11
to osm...@googlegroups.com

Great work indeed!
@Victor: to let the Srtm contours vectors and Srtm hillshade show together, they should overlap in show levels. Now the contour lines are visible in level 14, 15 and higher. The hillside tiles go from levels 0 -11. They are stretched to level 12, so level 13 shows neither of them. Maybe th tiles can be stretched up to level 13 or higher, and the contour lines come in at 12 or 13.
So we have an ultimate solution in the future ;-)

Andre

Op 13 nov. 2011 18:57 schreef "yvecai" <yve...@gmail.com> het volgende:

For zips, I'm not sure it's practical to unzip them if they are downloaded from a phone.
We can do that if the files are available directly from OsmAnd, like the other extracts.



Yves

On 11. 11. 11 13:34, Victor Shcherb wrote:


>
> Hi 
> Thanks for you work!!!
> Why you didn't put map into zips ;)

> I put your scripts to http...

yvecai

unread,
Nov 13, 2011, 1:36:07 PM11/13/11
to osm...@googlegroups.com
Contour lines at zoom 13 easily lead to memory errors, unfortunately. In mountaineous areas, it's a lot of lines!
Also, it seems that in the alps where I was walking yesterday, hillshade (sqlite) + contours +vector map need lot of memory too, even at zoom 15.
Yves

Victor Shcherb

unread,
Nov 13, 2011, 2:29:37 PM11/13/11
to osm...@googlegroups.com
To Andre

As I know general strategy to stretch images +2 zooms. If you have hillshade for 11th zoom so I suppose it will be stretched till 13th zoom.

I have no idea for vector rendering contours because I've never used it  and never deal with it :)

Victor

2011/11/13 yvecai <yve...@gmail.com>

andre van atten

unread,
Nov 13, 2011, 3:13:53 PM11/13/11
to osm...@googlegroups.com

I tested it, and it stretches only one level. If I take Srtm layers from sqlite package as main level and no additional maps, I cannot zoom in to level 13. It stops at level 12, and the package contains level 4 - 11, including 11.

Andre

Op 13 nov. 2011 20:29 schreef "Victor Shcherb" <victor....@gmail.com> het volgende:

Victor Shcherb

unread,
Nov 13, 2011, 4:15:16 PM11/13/11
to osm...@googlegroups.com
Probably it because the package sqlite package is downloadable. So it contains URL information, try to switch off "can be downloaded from internet" option. It is hard to experiment with sqlite package try to experiment with some small folder package. Take a look at ".metainfo" file and before copy to device try to remove url information.

As I see from https://github.com/osmandapp/Osmand/blob/master/OsmAnd/src/net/osmand/plus/views/MapTileLayer.java#L172-191 it should work for +2.

Best Regards,
Victor

2011/11/13 andre van atten <andrev...@gmail.com>

andre van atten

unread,
Nov 13, 2011, 4:38:26 PM11/13/11
to osm...@googlegroups.com

The package is not downloadable and doesn't even contain the url tag. Doublechecked also with sqlite3. Haven't tested yet with bare tiles.

Andre

Op 13 nov. 2011 22:15 schreef "Victor Shcherb" <victor....@gmail.com> het volgende:

yvecai

unread,
Nov 15, 2011, 4:05:27 PM11/15/11
to osm...@googlegroups.com
I think all European countries are done now.
I started to do the same with south and central america, and africa.
These countries should appears few at day, in alphabetical order.
This is still the Geofabrik polygons I'm using, so all the countries
won't be extracted now.

Yves

On 12. 11. 11 00:00, Shorty66 wrote:

yvecai

unread,
Nov 18, 2011, 3:35:08 PM11/18/11
to Osmand
Contours files are now directly available at:

http://www.pistes-nordiques.org/downloads/

At least the one already available, the computation goes on ...

andre van atten

unread,
Nov 18, 2011, 4:17:37 PM11/18/11
to osm...@googlegroups.com

Thanks Yves!

Great job. Andre

Op 18 nov. 2011 21:35 schreef "yvecai" <yve...@gmail.com> het volgende:

Rem Remmels

unread,
Nov 19, 2011, 6:53:38 AM11/19/11
to Osmand
On Nov 1, 7:39 pm, andre van atten <andrevanat...@gmail.com> wrote:
> Or check a smaller region. I did Netherlands, easy;-) nearly no height, so
> very few contourlines, but I also got lines around 0 meters and below
> sealevel. Yeah!

Where was that? I looked on many places but only saw 0-lines.
At Urk (NOP) I would expect -5 but all I see is 0.

As the contourlines only display from zoomlevel 14 (to higher) its
difficult to find.

Rem Remmels

unread,
Nov 19, 2011, 7:15:24 AM11/19/11
to Osmand
On Nov 8, 9:59 pm, yvecai <yve...@gmail.com> wrote:
> Hi all, it's working

Very good!

Great idea to convert SRTM to obf.

Didn't know what to do with your .obf files so just downloaded some
for osmand. Osmand displays your contour lines on zoomlevel 14
and higher.

It shows your .obf file together with the 'normal vector layer' obf
file.

That surprised me. Would think that I could choose it as an extra
layer
which one could check/uncheck. In Overlay map... or Underlay
map... Don't understand all this..

But anyhow... great work you did. Thanks.


yvecai

unread,
Nov 19, 2011, 9:59:58 AM11/19/11
to osm...@googlegroups.com
It's when there is nothing to do that it is most confusing for user:
let's say that you must sing something and stay on one foot while
downloading the file :)
Yves

Shorty66

unread,
Nov 19, 2011, 3:01:49 PM11/19/11
to Osmand
Hey yves!
Thanks for the germany file, i must have missed it.

I think it would be very cool if osmand could do the srtm to
contourlines calculation by itself.
That way we could use whatever DEM in SRTM Format we can get our hands
on and Osmand could even provide additional functions such as showing
the elevation profile of a track or routing the path with the least
difference in altitude.

Do you think that this would be püossible? Is the calcualtion to
complex for our phones?

bye,
shorty

yvecai

unread,
Nov 20, 2011, 2:27:12 AM11/20/11
to osm...@googlegroups.com
Hi Shorty,
Your idea would be a good way to overcome some license issue with DEMs,
as this could be considered as 'personal use', as opposed to the method
consisting of pre-processing the complete dataset to make it available
to anyone.

Calculating the elevation profile from a DEM shouldn't be too much for a
phone, I guess. It consist of looking for the pixel value of a few pixel
in a raster file.
Then, calculating hillshading is a step further in complexity, because
here you have to compare pixel values for a complete area. Last, contour
lines are probably a step further, because you need to sort of grow a
line of constant height from each pixel of the considered area.
All this is theoretical to me, because I'm just using existing tools to
work with SRTM dataset, I never looked how to calculate hillshading or
contours myself.
If you want to have a look at the algorithms used, here is a few
open-source references:
http://trac.osgeo.org/gdal/browser/trunk/gdal/apps/gdal_contour.cpp
http://svn.openstreetmap.org/applications/utils/srtm2shp/
http://wiki.openstreetmap.org/wiki/Srtm2osm_perl
http://svn.openstreetmap.org/applications/utils/Srtm2Osm/

For elevation profile on my website, I use some code from gpxtools.
http://lichota.pl/blog/gpxtools-tools-useful-to-manipulate-gpx-files?set_language=en

Yves

On 19. 11. 11 21:01, Shorty66 wrote:
> Hey yves!
> Thanks for the germany file, i must have missed it.
>
> I think it would be very cool if osmand could do the srtm to
> contourlines calculation by itself.
> That way we could use whatever DEM in SRTM Format we can get our hands
> on and Osmand could even provide additional functions such as showing
> the elevation profile of a track or routing the path with the least
> difference in altitude.
>

> Do you think that this would be p�ossible? Is the calcualtion to

David White

unread,
Nov 20, 2011, 2:43:48 AM11/20/11
to osm...@googlegroups.com

Ahem what are DEM files?

yvecai

unread,
Nov 20, 2011, 2:51:55 AM11/20/11
to osm...@googlegroups.com
Digital Elevation Model, I think.
They basically looks like raster images, but the pixel value is an
elevation value, and X,Y are geolocalized.

http://en.wikipedia.org/wiki/Digital_elevation_model

Yves

andre van atten

unread,
Nov 20, 2011, 8:42:00 AM11/20/11
to osm...@googlegroups.com

Yes,

That would make Osmand an even better 'killer' app, if it was able to process DEM files directly into hillshade and contour lines/ slope . However, that could not be done for large areas, but for detail maps of a single DEM or SRTM file it would be awesome.
I think it is a major job to convert algorithms to android, but maybe there are already java routines  to do that on the web. And indeed, it would overcome a lot of license problems.

Andre

Op 20 nov. 2011 08:27 schreef "yvecai" <yve...@gmail.com> het volgende:

Hi Shorty,
Your idea would be a good way to overcome some license issue with DEMs, as this could be considered as 'personal use', as opposed to the method consisting of pre-processing the complete dataset to make it available to anyone.

Calculating the elevation profile from a DEM shouldn't be too much for a phone, I guess. It consist of looking for the pixel value of a few pixel in a raster file.
Then, calculating hillshading is a step further in complexity, because here you have to compare pixel values for a complete area. Last, contour lines are probably a step further, because you need to sort of grow a line of constant height from each pixel of the considered area.
All this is theoretical to me, because I'm just using existing tools to work with SRTM dataset, I never looked how to calculate hillshading or contours myself.
If you want to have a look at the algorithms used, here is a few open-source references:
http://trac.osgeo.org/gdal/browser/trunk/gdal/apps/gdal_contour.cpp
http://svn.openstreetmap.org/applications/utils/srtm2shp/
http://wiki.openstreetmap.org/wiki/Srtm2osm_perl
http://svn.openstreetmap.org/applications/utils/Srtm2Osm/

For elevation profile on my website, I use some code from gpxtools.
http://lichota.pl/blog/gpxtools-tools-useful-to-manipulate-gpx-files?set_language=en

Yves

On 19. 11. 11 21:01, Shorty66 wrote:

Hey yves!
Thanks for the germany file, i must have missed it.

I think it would be very cool if osmand could do the srtm to
contourlines calculation by itself.
That way we could use whatever DEM in SRTM Format we can get our hands
on and Osmand could even provide additional functions such as showing
the elevation profile of a track or routing the path with the least
difference in altitude.

Do you think that this would be püossible? Is the calcualtion to

Shorty66

unread,
Nov 20, 2011, 1:31:47 PM11/20/11
to Osmand
I didnt even think of hillshading but thats a great idea!
I think this should be posted as a feature request (issue?).
Hillshading should be easily done as you would just apply appropriate
shades of grey to a directional derivative of pixel values.
Contourlines should be easy: just use linear interpolation between to
pixels which are near the height you want to render to get a node for
the graphing.
Sadly i aint able to program that but the math isn´t really hard.

> >http://trac.osgeo.org/gdal/**browser/trunk/gdal/apps/gdal_**contour.cpp<http://trac.osgeo.org/gdal/browser/trunk/gdal/apps/gdal_contour.cpp>
> >http://svn.openstreetmap.org/**applications/utils/srtm2shp/<http://svn.openstreetmap.org/applications/utils/srtm2shp/>
> >http://wiki.openstreetmap.org/**wiki/Srtm2osm_perl<http://wiki.openstreetmap.org/wiki/Srtm2osm_perl>
> >http://svn.openstreetmap.org/**applications/utils/Srtm2Osm/<http://svn.openstreetmap.org/applications/utils/Srtm2Osm/>


>
> > For elevation profile on my website, I use some code from gpxtools.

> >http://lichota.pl/blog/**gpxtools-tools-useful-to-**
> > manipulate-gpx-files?set_**language=en<http://lichota.pl/blog/gpxtools-tools-useful-to-manipulate-gpx-files?...>

Shorty66

unread,
Nov 20, 2011, 1:41:59 PM11/20/11
to Osmand
I just created an appropriate issue:

http://code.google.com/p/osmand/issues/detail?id=727

yvecai

unread,
Dec 3, 2011, 3:28:09 AM12/3/11
to Osmand
Update: Now Africa, Americas and Europe are completed (and zipped).

. Go to http://www.pistes-nordiques.org/downloads
. Download your country
. Copy it to your /Osmand/ folder in your device
. Contours (isohypses) are now available in the vector map from zoom
14

Yves

Reply all
Reply to author
Forward
0 new messages