Hello Carlos,
First of all - really great approach. Summarizing your understanding
as a way to frame further questions is really helpful, so thanks for
this effort.
I assume that Robert and others will also respond, but I'll provide my
thoughts inline...
On Mar 27, 2010, at 3:16 AM, Carlos Enrique López Garcés wrote:
Good evening, and thanks again for your replies. I wanted to do some
research before replying again, so I include here my interpretation
of each of your ideas. I'll start with the ideas that Robert Coup
kindly shared. I'd appreciate if you could tell me if I
misunderstood something:
As I understand, based on the discussion thread 'Mapnik viewer and
OSM rendering' (http://www.mail-archive.com/[email protected]/msg00096.html
), there is an experimental branch developed by Ben Moores in which
wxpdfdoc (http://wxcode.sourceforge.net/components/wxpdfdoc/, a c++
library for creating PDF documents) is used to render maps on PDF
documents and many of the features mentioned below are already
included.
Yes!
I personally was not very familiar with this branch, and would be
curious from Robert to have some pointers to the virtues of wxpdfdoc.
Ideas from Robert Coup:
-----------------------------------
Port features from wxpdf (/branches/experimental-pdf/) to a Cairo-
based PDF renderer, including:
- Adding a border to the map to show coordinates: I interpret this
as displaying a frame around the map that shows the longitude and
latitude coordinates. The more the map is zoomed in, the more exact
the coordinates will be.
good description.
- Grids: I interpret this as displaying the longitude and latitude
lines over the map.
yes
- Scale bars: Display the chart that shows the scale of the map
graphically (http://en.wikipedia.org/wiki/Linear_scale).
Yes, this can take a few different forms but in general the idea is to
graphically display the relationship between real world distance and
map distance.
Very recently a Mapnik user added scales using pycairo, which could
act as a guide for porting/exposing these features in C++/Mapnik Core.
http://oliverobrien.co.uk/2010/03/map-adornments-with-cairo/
- Overlay images, including other PDFs: Does the 'overlay' concept
have the same meaning as in Google Maps? According to Google Maps'
documentation, an overlay is an object attached to a coordinate,
like the markers used to point to places (http://code.google.com/apis/maps/documentation/mapplets/overlays.html#Markers
). If this is true, then this feature is about displaying these
overlay images on the exact points indicated by the associated
coordinates (considering that the units used for displaying on the
screen and printing on a document are different, am I right?). I'm
not sure if I understand the part 'including other PDFs', though.
Yes, I think you are on the right track. Robert will likely clarify,
but I imagine the idea is that you could combine map information from
Mapnik with existing PDF documents that do not have an explicit
geographical reference. These PDF's could likely contain anything,
points, lines, polygons, or text and would be positioned on the page
in screen coordinates rather than geographical coordinates, but this
is just a guess.
- Paper sizes/scale calculations: I read that images are displayed
on paper based on DPI units, so some calculations are needed to
scale the maps to fit different paper sizes. Tom Hughes mentions in
the same thread that there are some issues that need to be
considered when tranlating the units used by Mapnik and those of
Cairo.
Yes, these are core issues that should be worked out, tested,
investigated pretty early. I see you are playing around with http://trac.mapnik.org/ticket/343
, which is great.
- Map layers as PDF layers: According to what I read, the objects
displayed on a PDF page can be organized in layers, which can be
hidden. As a map is rendered in layers, whose order is defined by a
Mapnik configuration file (http://trac.mapnik.org/wiki/XMLConfigReference
), a PDF layer may be mapped to a map layer.
Yes, mostly. Basically most recent PDF viewers support the idea of
layers, such that users can turn various layers on and off, adding
interactivity and usefulness of the document, particularly when map
data is included. Being able to maintain the exact "<Layer>" elements
created by a user authoring a Mapnik XML file as "layers" in the
resulting PDF file would be an excellent thing, but potentially users
would also want combinations of Mapnik <Layer>'s to be exposed as PDF
"layers".
Hiding a PDF layer in a PDF viewer should cause the 'status'
attribute of the corresponding map layer to be set to OFF, causing
it not be rendered.
Not exactly. The 'status' attribute for Mapnik does determine whether
the user wants the layer rendered. But this only applies to Mapnik and
once the PDF was written this attribute does not apply, as some other
mechanism in the PDF viewer would be used by the user to turn on and
off the layers.
Finally, I read that Tom Hughes wrote a Cairo-based renderer, but I
would like to ask you if these features are already covered by it.
They are not yet supported by our usage in the Cairo renderer. But the
Cairo API could certainly be used to implement these within Mapnik.
Great stuff. Keep on asking questions!
Thanks,
Dane
I'll do some research before replying to Mr. Pavlenko's and Mr.
Marquardt ideas. There's also an idea from Ben Moores about
automatic legend generation; is it related to what you say about
legends, Mr. Marquardt?
Thanks,
Carlos López
2010/3/20 Robert Coup <[email protected]>
Hi Carlos,
2010/3/21 Carlos Enrique López Garcés <[email protected]>:
> Good evening Mapnik community,
> I've been searching for information about the 'Better Print
Support' project
> idea and I was wondiering if anyone could tell me how to contact
Tom Carden.
> He submitted the project idea, so I thought it would be a good
idea to ask
> him about it. Any suggestions will be really appreciated. Thanks.
It's also worth having a look at the code on the (abandoned) wxpdf
branch. See this post (and others by Ben) to have a look:
http://www.mail-archive.com/[email protected]/
msg00140.html
it has/had some cool features which could be worth porting to a
Cairo-based PDF renderer.
* paper sizes/scale calculations
* grids/graticules
* overlay images, including other PDFs
* scale bars
* borders around the map, with coordinates
* outputting map layers as true PDF layers. This allows turning on &
off individual layers in a PDF viewer.
The addition of SVG symbol support makes things more scalable too...
Rob :)
_______________________________________________
Mapnik-devel mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mapnik-devel
_______________________________________________
Mapnik-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mapnik-users