0

I am looking for a really simple thing: Getting a image of a map. I already found some solutions like using openlayers and capturing a screenshot of a openlayers site with phantom js (requires qt) or a solution like the one posted here: https://help.openstreetmap.org/questions/23034/maps-to-static-image-to-be-stored-on-a-mobile-application But this uses Mapnik, which has a bunch of dependencies. Since I want to generate the mapimages on a slim ARM linux, I need a much more lightweight solution, with less dependencies.

Any ideas? :)

Edit: So what do I want to achieve?

  • Map should be offline accessible
  • Display a map with markers and polygons in a mobile QtQuick Application
  • -> QtQuick Application can't render html files (because it runs on android)
  • -> My idea for displaying maps: The app communicates with an arm linux machine (which is already used for the app), which sends preprocessed pictures of the currently needed map.

asked 23 May '14, 09:24

DerMas's gravatar image

DerMas
11113
accept rate: 0%

edited 23 May '14, 15:21

Is style of "the map" something that you will create yourself, or an existing one?

(23 May '14, 09:31) SomeoneElse ♦

I can use an existing style. Only custom thing I would like to do is to add markers and maybe polygons to the map.

(23 May '14, 09:55) DerMas

Perhaps it would help to take a step back and explain what problem it is that you're trying to solve? So far we know that it involves creating images involving a standard map style overlaid with markers and maybe polygons. We don't know if it has to be automated in some way, or where the "slim ARM linux" fits in (an ARM architecture would just perhaps require more stuff to be built from source, no?).

(23 May '14, 14:14) SomeoneElse ♦

Ok, adding it to the question.

(23 May '14, 14:46) DerMas

2 Answers:
3

Our wiki page about Rendering lists a few options. MapWeaver, for example, is a somewhat niche rendering engine that might fit your needs. Be aware that the least "lightweight" thing about all this will likely be to grab the data - it sounds like you would not want to have a 25 GB planet file lying around, much less keep the world's geodata available in a database. If you don't have the data locally then you will need to download it from a server whenever you want to generate a map, and that would then limit your options because you'd be placing load on the server.

permanent link

answered 23 May '14, 12:18

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
73.3k866641137
accept rate: 24%

1

Sounds great, will look into it :)

I have only tiles of certain areas, so that shouldn't be a problem.

edit: Unfortunately pearl doesn't work on the system :/ Python would work though, but I looked at the wiki page you mentioned and couldn't find a still maintained python project.

(23 May '14, 12:59) DerMas
1

Is it so hard to get perl working on your system?

(23 May '14, 13:40) scai ♦

It is and I saw that mapweaver uses .osm files as input, which won't work for me also.

(23 May '14, 14:06) DerMas
0

I'd probably use a Leaflet-based map for that. Leaflet's small enough so that it'll fit happily in a mobile phone app, for example, so your "slim Linux" option should be possible too.

permanent link

answered 23 May '14, 10:28

SomeoneElse's gravatar image

SomeoneElse ♦
33.0k65343778
accept rate: 16%

Not sure if I understand the getting started page of leaflet correct, but doesnt that just create a html map object instead of a static png image? I really need an image, which I can send to other machines, that cant render html pages. But maybe I have overlooked something. Could you give me a little push into the right direction?

(23 May '14, 10:42) DerMas

I was assuming that you'd be able to take a screenshot of the HTML map (with standard background, and things such as markers drawn on it).

(23 May '14, 10:43) SomeoneElse ♦

That would involve using phantomJS and qt (maybe there are other lightweight tools for taking screenshots of a html page?). I forgot to mention, that it is not only a lightweight linux, it is also an ARM machine.

(23 May '14, 11:21) DerMas

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×443
×294
×53
×13
×2

question asked: 23 May '14, 09:24

question was seen: 7,650 times

last updated: 23 May '14, 15:21

powered by OSQA