Mapnik Not Rendering Correctly

View: New views
12 Messages — Rating Filter:   Alert me  

Mapnik Not Rendering Correctly

by Eamorr :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm having trouble with the mapnik rendering at high zoom levels.

As can be seen from the following images, the rendering is perfectly fine:

http://www.xlhi.com/z1.png
http://www.xlhi.com/z2.png
http://www.xlhi.com/z3.png
http://www.xlhi.com/z4.png
http://www.xlhi.com/z5.png
http://www.xlhi.com/z6.png
http://www.xlhi.com/z7.png

It's when you zoom right in, the rendering goes all funny as shown in these two screenshots:
http://www.xlhi.com/z8.png
http://www.xlhi.com/z9.png

As can be seen, the roads are no longer drawn, but the road names and parklands, etc. are shown.

I haven't a clue what's causing this! Is my machine too slow? (It's a bog standard AMD 1.5GHz with 512MB RAM).

Any ideas much appreciated.

Thanks in advance,

Eamorr

Re: Mapnik Not Rendering Correctly

by Frederik Ramm :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

Eamorr wrote:
> As can be seen from the following images, the rendering is perfectly fine:

[...]

> As can be seen, the roads are no longer drawn, but the road names and
> parklands, etc. are shown.

The select query that is done to collect the roads may be different on
those zoom levels. It is possible that for some reason the query fails,
giving you tiles without roads.

If you're using OSM data, this is likely to happen if you use an older
osm2pgsql style file (say, one that does not produce a "service" column
on the roads table) but use a recent Mapnik style (which depends on the
"service" column being present). Your Postgres log file should inform
you of any failed queries.

Bye
Frederik

--
Frederik Ramm  ##  eMail frederik@...  ##  N49°00'09" E008°23'33"
_______________________________________________
Mapnik-users mailing list
Mapnik-users@...
https://lists.berlios.de/mailman/listinfo/mapnik-users

Re: Mapnik Not Rendering Correctly

by Eamorr :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

Thanks for your insight.

I tried examining /var/log/postgresql/postgresql-8.3-main.log

No errors are showing up.

Could you point me in the right direction regarding changing the style file?

Many thanks in advance,

Eamorr

Eamorr wrote:
I'm having trouble with the mapnik rendering at high zoom levels.

As can be seen from the following images, the rendering is perfectly fine:

http://www.xlhi.com/z1.png
http://www.xlhi.com/z2.png
http://www.xlhi.com/z3.png
http://www.xlhi.com/z4.png
http://www.xlhi.com/z5.png
http://www.xlhi.com/z6.png
http://www.xlhi.com/z7.png

It's when you zoom right in, the rendering goes all funny as shown in these two screenshots:
http://www.xlhi.com/z8.png
http://www.xlhi.com/z9.png

As can be seen, the roads are no longer drawn, but the road names and parklands, etc. are shown.

I haven't a clue what's causing this! Is my machine too slow? (It's a bog standard AMD 1.5GHz with 512MB RAM).

Any ideas much appreciated.

Thanks in advance,

Eamorr

Re: Mapnik Not Rendering Correctly

by Lennard-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Eamorr wrote:

> I tried examining /var/log/postgresql/postgresql-8.3-main.log
>
> No errors are showing up.

That's because the sql queries probably succeed, when they're doing
select *. It's when the results get to the mapnik filters, that mapnik
notices it doesn't have a specific column, and is silently dropping the
while style/rule.

> Could you point me in the right direction regarding changing the style file?

Have a look at
http://trac.openstreetmap.org/browser/applications/utils/export/osm2pgsql/default.style 
and make sure you have at least those fields in your own default.style.


--
Lennard
_______________________________________________
Mapnik-users mailing list
Mapnik-users@...
https://lists.berlios.de/mailman/listinfo/mapnik-users

Re: Mapnik Not Rendering Correctly

by Eamorr :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Lennard-2 wrote:
That's because the sql queries probably succeed, when they're doing
select *. It's when the results get to the mapnik filters, that mapnik
notices it doesn't have a specific column, and is silently dropping the
while style/rule.
Hi, do you have any suggestions as to how I might fix this? I thought about changing the map style and seeing if that works, but after much searching, I don't know where to start with regards to altering the rendering style.

Lennard-2 wrote:
Have a look at
http://trac.openstreetmap.org/browser/applications/utils/export/osm2pgsql/default.style 
and make sure you have at least those fields in your own default.style.
I couldn't find a file named "default.style" anywhere on my system.

Thanks in advance,

Eamorr

Re: Mapnik Not Rendering Correctly

by Lennard-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Eamorr wrote:

> Hi, do you have any suggestions as to how I might fix this? I thought about
> changing the map style and seeing if that works, but after much searching, I
> don't know where to start with regards to altering the rendering style.

Start at the beginning, and don't try to 'fix' a map style which is
known to work on the main OpenStreetMap site, and for countless others.
The only thing you should change with the osm.xml is the path to the
symbols used, and the access details for your postgis database in the
<Layer>s.

> I couldn't find a file named "default.style" anywhere on my system.

How are you importing the OSM data to your postgis db, then? The file is
a part of osm2pgsql.

Actually, *are* you using OpenStreetMap data, or do you have another
dataset?


--
Lennard
_______________________________________________
Mapnik-users mailing list
Mapnik-users@...
https://lists.berlios.de/mailman/listinfo/mapnik-users

Re: Mapnik Not Rendering Correctly

by Jon Burgess-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wed, 2009-06-24 at 12:26 -0700, Eamorr wrote:
> Lennard-2 wrote:
> >
> > Have a look at
> >
> http://trac.openstreetmap.org/browser/applications/utils/export/osm2pgsql/default.style 
> > and make sure you have at least those fields in your own
> default.style.
> >
> I couldn't find a file named "default.style" anywhere on my system.

It should be in the same directory as the osm2pgsql tool which you used
to import the data into Postgresql. If there is no default.style then
perhaps you have a really old version of osm2pgsql which has the style
hard coded. What does it say when you run osm2pgsql?

        Jon


_______________________________________________
Mapnik-users mailing list
Mapnik-users@...
https://lists.berlios.de/mailman/listinfo/mapnik-users

Re: Mapnik Not Rendering Correctly

by Eamorr :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Lennard-2 wrote:
Start at the beginning, and don't try to 'fix' a map style which is
known to work on the main OpenStreetMap site, and for countless others.
The only thing you should change with the osm.xml is the path to the
symbols used, and the access details for your postgis database in the
<Layer>s.
Thanks for the message. I haven't changed anything in osm.xml nor am I trying to tinker with the default styling. These high zoom level rendering problems occur from the unmodified installation.

Lennard-2 wrote:
How are you importing the OSM data to your postgis db, then? The file is
a part of osm2pgsql.
Oh right, well it's nowhere on my system. I'm using osm2pgsql to sucessfully convert the openstreetmap data to postgis.

Lennard-2 wrote:
Actually, *are* you using OpenStreetMap data, or do you have another
dataset?
Yes, I'm using the OSM data.

I wonder if I played around with the osm.xml file, would this have any effect on the high zoom level rendering?

Thanks again.

Re: Mapnik Not Rendering Correctly

by Eamorr :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Jon Burgess-2 wrote:
On Wed, 2009-06-24 at 12:26 -0700, Eamorr wrote:
> Lennard-2 wrote:
> >
> > Have a look at
> >
> http://trac.openstreetmap.org/browser/applications/utils/export/osm2pgsql/default.style 
> > and make sure you have at least those fields in your own
> default.style.
> >
> I couldn't find a file named "default.style" anywhere on my system.

It should be in the same directory as the osm2pgsql tool which you used
to import the data into Postgresql. If there is no default.style then
perhaps you have a really old version of osm2pgsql which has the style
hard coded. What does it say when you run osm2pgsql?

        Jon
Hi,

Thanks for the message.

Here's what's output when I type in 'osm2pgsql':
osm2pgsql SVN version 0.52-20080912 $Rev: 7141 $

Usage:
        osm2pgsql [options] planet.osm
        osm2pgsql [options] planet.osm.{gz,bz2}
        osm2pgsql [options] file1.osm file2.osm file3.osm

This will import the data from the OSM file(s) into a PostgreSQL database
suitable for use by the Mapnik renderer

Options:
   -a|--append          Add the OSM file into the database without removing
                        existing data.
   -b|--bbox            Apply a bounding box filter on the imported data
                        Must be specified as: minlon,minlat,maxlon,maxlat
                        e.g. --bbox -0.5,51.25,0.5,51.75
   -c|--create          Remove existing data from the database. This is the
                        default if --append is not specified.
   -d|--database        The name of the PostgreSQL database to connect
                        to (default: gis).
   -l|--latlong         Store data in degrees of latitude & longitude.
   -m|--merc            Store data in proper spherical mercator, not OSM merc
   -E|--proj num        Use projection EPSG:num
   -u|--utf8-sanitize   Repair bad UTF8 input data (present in planet
                        dumps prior to August 2007). Adds about 10% overhead.
   -p|--prefix          Prefix for table names (default planet_osm)
   -U|--username        Postgresql user name.
   -W|--password        Force password prompt.
   -H|--host            Database server hostname or socket location.
   -P|--port            Database server port.
   -h|--help            Help information.
   -v|--verbose         Verbose output.

Add -v to display supported projections.
Use -E to access any espg projections (usually in /usr/share/proj/epsg)
I presumed I was using the most up-to-date version of osm2pgsql. I'll look into it.

Re: Mapnik Not Rendering Correctly

by Jon Burgess-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wed, 2009-06-24 at 13:15 -0700, Eamorr wrote:
> Thanks for the message.
>
> Here's what's output when I type in 'osm2pgsql':
>
>
> > osm2pgsql SVN version 0.52-20080912 $Rev: 7141 $

That looks like the old version packaged by Debian/Ubuntu, you should
download and run the latest SVN version of osm2pgsql:
* Install subversion, if not installed already
* svn co http://svn.openstreetmap.org/applications/utils/export/osm2pgsql
* cd osm2pgsql
* make
* sudo make install

        Jon


_______________________________________________
Mapnik-users mailing list
Mapnik-users@...
https://lists.berlios.de/mailman/listinfo/mapnik-users

Re: Mapnik Not Rendering Correctly

by Eamorr :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Jon,

Yes, you're right. I'm using an ancient version of osm2pgsl (installed via Ubuntu/Synaptic).

I've just installed the latest version of osm2pgsql and I'm about to re-run the script.

Will report back on how I'm getting on lest anyone else fall into this trap.

Many thanks for your help,

Eamorr




Jon Burgess-2 wrote:
On Wed, 2009-06-24 at 13:15 -0700, Eamorr wrote:
> Thanks for the message.
>
> Here's what's output when I type in 'osm2pgsql':
>
>
> > osm2pgsql SVN version 0.52-20080912 $Rev: 7141 $

That looks like the old version packaged by Debian/Ubuntu, you should
download and run the latest SVN version of osm2pgsql:
* Install subversion, if not installed already
* svn co http://svn.openstreetmap.org/applications/utils/export/osm2pgsql
* cd osm2pgsql
* make
* sudo make install

        Jon


_______________________________________________
Mapnik-users mailing list
Mapnik-users@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/mapnik-users

Re: Mapnik Not Rendering Correctly

by Eamorr :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

It's working now.

The problem was I was using an ancient version of osm2pgsql.

A million thanks to all,

Eamorr