Re: [OSM-dev] Automatically triggering export as PDF from openstreetmap.org -> share?

2017-12-22 Thread Bjoern Hassler
Hi Joost, hi Martin,

thanks for the comments - I'll have a look. I may just print the maps by
hand from the OSM site for now, and look into more advanced options in the
future.

QGIS lets you export / print to raster (png), pdf (AFAIK both, raster and
> vector, there's an option "print as raster") and svg (not working well,
> e.g. I had problems with uncropped lines at the border). Depending on your
> settings (resolution, scale and feature density on the map), it is not a
> given that a vector representation will produce smaller files in any case
> (when zoomed in you will usually get smaller files, if there is a lot of
> detail in a large scale map, you will not see it in the print, but it will
> inflate your file).
>

Yes of course - that's very true! In my case, I'm producing maps a few 100m
across (the size of a college).

Many thanks again!
Bjoern
___
dev mailing list
dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/dev


Re: [OSM-dev] Automatically triggering export as PDF from openstreetmap.org -> share?

2017-12-22 Thread Martin Koppenhoefer
2017-12-22 10:27 GMT+01:00 joost schouppe :

>
> Third, you should be able to rotate through the set of places with the
> Atlas function.
> Last, export to PDF; I have no idea if QGIS can produce the kind of PDFs
> you need.
>


I've also recently made some maps for print with QGIS. As Joost says, you
will usually get a pbf osm file, import it into a database (I'm using the
standard osm2pgsql with latlong for this with hstore, although my QGIS
versions requires to create views for selecting hstore fields, which makes
it a bit more tedious, in the end I got it working). I'm using latlong
because I'm reprojecting on the fly to different systems in different
areas.

QGIS lets you export / print to raster (png), pdf (AFAIK both, raster and
vector, there's an option "print as raster") and svg (not working well,
e.g. I had problems with uncropped lines at the border). Depending on your
settings (resolution, scale and feature density on the map), it is not a
given that a vector representation will produce smaller files in any case
(when zoomed in you will usually get smaller files, if there is a lot of
detail in a large scale map, you will not see it in the print, but it will
inflate your file).

Cheers,
Martin
___
dev mailing list
dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/dev


Re: [OSM-dev] Automatically triggering export as PDF from openstreetmap.org -> share?

2017-12-22 Thread joost schouppe
I'm not familiar with the exact workflow in QGIS, but I think you could
probably fully automate this process with it.

On the data side, just download a county PBF file (for example from
geofabrik), and convert it to a database. I always use spatialite for
things like this, here's a manual:
https://github.com/osmbe/qgis_rendering/blob/master/qgis-loves-spatialite.md
Or you could use the shapefiles provided there.

Then you need a set of rendering rules. There seem to be some basic styles
around that you could reuse:
https://gis.stackexchange.com/questions/90086/is-there-a-good-qml-or-sld-file-available-for-qgis-openstreetmap-data
Updating your maps would just be a matter of replacing the source files.

Third, you should be able to rotate through the set of places with the
Atlas function.
Last, export to PDF; I have no idea if QGIS can produce the kind of PDFs
you need.

2017-12-22 10:06 GMT+01:00 Bjoern Hassler :

> Dear Frederik, dear Paul,
>
> Thank you for your message! I suppose I made the mistake of asking for a
> technical fix, rather than fully explaining the problem...
>
> I have 40 small, discontinues areas in Ghana (the 40 public colleges of
> education), like this
> http://www.openstreetmap.org/way/450562441#map=16/7.4129/0.4631
> and I want to produce print. The files itself will be downloaded locally
> (or emailed), and then printed locally. So the file needs to be small, and
> print resolution (say for A2 or A3).
>
> We're actively editing this at the moment (and have been over the last
> year), so we'd like to print from up-to-date data.
>
> Print + small files, means PDF, as its vector, and can be printed at any
> size. I assume PNG at 300dpi, A3, would be massive.
>
> There aren't loads of areas, and manual export would be ok. However,
> because the areas are discontinuous, I am looking for a solution where I
> can work from lat/lon, rather than having to manually select areas. Once
> this would be ok, but we'd like to be able to repeat the export later. Most
> tools don't allow you to go back to maps that you've already produced, to
> reprint simply with data a year on.
>
>
>
>> https://operations.osmfoundation.org/policies/tiles/
>> ...
>
> so using a script to produce these PDFs would violate the policy except
>> in rare circumstances where running the script is triggered by a user
>> request.
>>
>
> I'd be quite happy to click manually. At the moment, I enter the values
> for scale manually, resize the browser window so it gives me the right
> nominal dimensions (for PDF), then export. However, it would be helpful to
> have a preconfigured link, that gives me my settings (scale, dimensions).
>
>>
>> * download and stitch tiles, convert to PDF; search for "OSM bigmap" for
>> different implementations.
>
> * use the "staticmap" script on openstreetmap.de like this:
>> http://staticmap.openstreetmap.de/staticmap.php?center=40,-
>> 50=2=500x350
>>
>> Both will only give you standard resolution raster images.
>
>
> As above, vector would be preferable.
>
>
>> You could
>> also try
>>
>> * https://maposmatic.osm-baustelle.de/ (a working fork of the
>> discontinued MapOsMatic project, does PDFs)
>>
>
> I'll see whether it's possible to generate maps of predefined areas or
> re-print maps (with the same boundaries). At least from the web UI, it
> doesn't look like it.
>
>
>> * http://printmaps-osm.de:8080/ (Europe only, quarterly data updates,
>> does PDFs in theory but currently only PNG works)
>>
>
> I'm outside Europe, and need up-to-date data.
>
>
>> or if you're on Windows or willing to use Mono, Maperitive can also
>> generate PDFs for any region using data from Overpass, and it's
>> scriptable (even headless).
>>
>
> OK, I'll have a look. However, it looks like it produces only SVG, which
> I'd then have to process.
>
>
>>
>> Of course, the canonical solution is "install your own
>> postgres/mapnik/nik4.py and run it locally" ;)
>>
>>
> Paul, why is the recommendation to produce PNG first?
>
> Thanks both for you input - much appreciated!!
> Bjoern
>
>
> ___
> dev mailing list
> dev@openstreetmap.org
> https://lists.openstreetmap.org/listinfo/dev
>
>


-- 
Joost Schouppe
OpenStreetMap  |
Twitter  | LinkedIn
 | Meetup

___
dev mailing list
dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/dev


Re: [OSM-dev] Automatically triggering export as PDF from openstreetmap.org -> share?

2017-12-22 Thread Yves
Have a look at the print function at Opensnowmap.org, it's just a bit of 
Javascript and Leaflet or Openlayers to achieve a pdf printing from a browser. 
Yves 

Le 22 décembre 2017 10:06:00 GMT+01:00, Bjoern Hassler  a 
écrit :
>Dear Frederik, dear Paul,
>
>Thank you for your message! I suppose I made the mistake of asking for
>a
>technical fix, rather than fully explaining the problem...
>
>I have 40 small, discontinues areas in Ghana (the 40 public colleges of
>education), like this
>http://www.openstreetmap.org/way/450562441#map=16/7.4129/0.4631
>and I want to produce print. The files itself will be downloaded
>locally
>(or emailed), and then printed locally. So the file needs to be small,
>and
>print resolution (say for A2 or A3).
>
>We're actively editing this at the moment (and have been over the last
>year), so we'd like to print from up-to-date data.
>
>Print + small files, means PDF, as its vector, and can be printed at
>any
>size. I assume PNG at 300dpi, A3, would be massive.
>
>There aren't loads of areas, and manual export would be ok. However,
>because the areas are discontinuous, I am looking for a solution where
>I
>can work from lat/lon, rather than having to manually select areas.
>Once
>this would be ok, but we'd like to be able to repeat the export later.
>Most
>tools don't allow you to go back to maps that you've already produced,
>to
>reprint simply with data a year on.
>
>
>
>> https://operations.osmfoundation.org/policies/tiles/
>> ...
>
>so using a script to produce these PDFs would violate the policy except
>> in rare circumstances where running the script is triggered by a user
>> request.
>>
>
>I'd be quite happy to click manually. At the moment, I enter the values
>for
>scale manually, resize the browser window so it gives me the right
>nominal
>dimensions (for PDF), then export. However, it would be helpful to have
>a
>preconfigured link, that gives me my settings (scale, dimensions).
>
>>
>> * download and stitch tiles, convert to PDF; search for "OSM bigmap"
>for
>> different implementations.
>
>* use the "staticmap" script on openstreetmap.de like this:
>>
>http://staticmap.openstreetmap.de/staticmap.php?center=40,-50=2=
>> 500x350
>>
>> Both will only give you standard resolution raster images.
>
>
>As above, vector would be preferable.
>
>
>> You could
>> also try
>>
>> * https://maposmatic.osm-baustelle.de/ (a working fork of the
>> discontinued MapOsMatic project, does PDFs)
>>
>
>I'll see whether it's possible to generate maps of predefined areas or
>re-print maps (with the same boundaries). At least from the web UI, it
>doesn't look like it.
>
>
>> * http://printmaps-osm.de:8080/ (Europe only, quarterly data updates,
>> does PDFs in theory but currently only PNG works)
>>
>
>I'm outside Europe, and need up-to-date data.
>
>
>> or if you're on Windows or willing to use Mono, Maperitive can also
>> generate PDFs for any region using data from Overpass, and it's
>> scriptable (even headless).
>>
>
>OK, I'll have a look. However, it looks like it produces only SVG,
>which
>I'd then have to process.
>
>
>>
>> Of course, the canonical solution is "install your own
>> postgres/mapnik/nik4.py and run it locally" ;)
>>
>>
>Paul, why is the recommendation to produce PNG first?
>
>Thanks both for you input - much appreciated!!
>Bjoern
___
dev mailing list
dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/dev


Re: [OSM-dev] Automatically triggering export as PDF from openstreetmap.org -> share?

2017-12-22 Thread Bjoern Hassler
Dear Frederik, dear Paul,

Thank you for your message! I suppose I made the mistake of asking for a
technical fix, rather than fully explaining the problem...

I have 40 small, discontinues areas in Ghana (the 40 public colleges of
education), like this
http://www.openstreetmap.org/way/450562441#map=16/7.4129/0.4631
and I want to produce print. The files itself will be downloaded locally
(or emailed), and then printed locally. So the file needs to be small, and
print resolution (say for A2 or A3).

We're actively editing this at the moment (and have been over the last
year), so we'd like to print from up-to-date data.

Print + small files, means PDF, as its vector, and can be printed at any
size. I assume PNG at 300dpi, A3, would be massive.

There aren't loads of areas, and manual export would be ok. However,
because the areas are discontinuous, I am looking for a solution where I
can work from lat/lon, rather than having to manually select areas. Once
this would be ok, but we'd like to be able to repeat the export later. Most
tools don't allow you to go back to maps that you've already produced, to
reprint simply with data a year on.



> https://operations.osmfoundation.org/policies/tiles/
> ...

so using a script to produce these PDFs would violate the policy except
> in rare circumstances where running the script is triggered by a user
> request.
>

I'd be quite happy to click manually. At the moment, I enter the values for
scale manually, resize the browser window so it gives me the right nominal
dimensions (for PDF), then export. However, it would be helpful to have a
preconfigured link, that gives me my settings (scale, dimensions).

>
> * download and stitch tiles, convert to PDF; search for "OSM bigmap" for
> different implementations.

* use the "staticmap" script on openstreetmap.de like this:
> http://staticmap.openstreetmap.de/staticmap.php?center=40,-50=2=
> 500x350
>
> Both will only give you standard resolution raster images.


As above, vector would be preferable.


> You could
> also try
>
> * https://maposmatic.osm-baustelle.de/ (a working fork of the
> discontinued MapOsMatic project, does PDFs)
>

I'll see whether it's possible to generate maps of predefined areas or
re-print maps (with the same boundaries). At least from the web UI, it
doesn't look like it.


> * http://printmaps-osm.de:8080/ (Europe only, quarterly data updates,
> does PDFs in theory but currently only PNG works)
>

I'm outside Europe, and need up-to-date data.


> or if you're on Windows or willing to use Mono, Maperitive can also
> generate PDFs for any region using data from Overpass, and it's
> scriptable (even headless).
>

OK, I'll have a look. However, it looks like it produces only SVG, which
I'd then have to process.


>
> Of course, the canonical solution is "install your own
> postgres/mapnik/nik4.py and run it locally" ;)
>
>
Paul, why is the recommendation to produce PNG first?

Thanks both for you input - much appreciated!!
Bjoern
___
dev mailing list
dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/dev