generate_tiles.py problem

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

generate_tiles.py problem

by Eamorr :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Greetings,

I've installed PostGreSQL and PostGIS and sucessfully loaded Ireland (ireland.osm) into the database.

I've tried doing the following:

source set-mapnik-env
./customize-mapnik-map > $MAPNIK_MAP_FILE
./generate_tiles.py

(I've edited set-mapnik-env and generate_tiles as appropriate)

The problem is, when I run 'generate_tiles.py' - nothing happens! No error messages, nothing, it just quits after a split-second.

I'm completely stumped and have no idea what to do now.

Could anyone give me any suggestions?

Many thanks,

Re: generate_tiles.py problem

by Jon Burgess-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, 2009-06-12 at 04:32 -0700, Eamorr wrote:

>
> Greetings,
>
> I've installed PostGreSQL and PostGIS and sucessfully loaded Ireland
> (ireland.osm) into the database.
>
> I've tried doing the following:
>
> source set-mapnik-env
> ./customize-mapnik-map > $MAPNIK_MAP_FILE
> ./generate_tiles.py
>
> (I've edited set-mapnik-env and generate_tiles as appropriate)
>
> The problem is, when I run 'generate_tiles.py' - nothing happens! No
> error
> messages, nothing, it just quits after a split-second.
>
> I'm completely stumped and have no idea what to do now.
>
> Could anyone give me any suggestions?

I'm not sure why your mail took so long to reach the list, I guess you
are not subscribed?

What is the BBOX value that you have set?
If you get the parameters in the wrong order then it will think that
there are no tiles to render.

        Jon




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

Re: generate_tiles.py problem

by Eamorr () :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks for the suggestion.

I'm having trouble with the bbox values. Am I right in saying that the bbox is in meters and not in decimal degrees?


 

Eamorr wrote:
Greetings,

I've installed PostGreSQL and PostGIS and sucessfully loaded Ireland (ireland.osm) into the database.

I've tried doing the following:

source set-mapnik-env
./customize-mapnik-map > $MAPNIK_MAP_FILE
./generate_tiles.py

(I've edited set-mapnik-env and generate_tiles as appropriate)

The problem is, when I run 'generate_tiles.py' - nothing happens! No error messages, nothing, it just quits after a split-second.

I'm completely stumped and have no idea what to do now.

Could anyone give me any suggestions?

Many thanks,

Re: generate_tiles.py problem

by Eamorr () :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Here's my javascript:
 
var options ={
        maxResolution: "auto",
        maxExtent: new OpenLayers.Bounds(-10.93, 51.26, -5.21, 55.56),
        minResolution: "auto",
        resolutions:[156543.03390000001, 78271.516950000005, 39135.758475000002, 19567.879237500001, 9783.9396187500006, 4891.9698093750003, 2445.9849046875001, 1222.9924523437501, 611.49622617187504, 305.74811308593752, 152.87405654296876, 76.43702827148438, 38.21851413574219, 19.109257067871095, 9.5546285339355475, 4.7773142669677737, 2.3886571334838869, 1.1943285667419434, 0.59716428337097172, 0.29858214168548586],
        numZoomLevels: 16,
        spherical_mercator: true
};
               
map = new OpenLayers.Map( $('map'), options);
layer = new OpenLayers.Layer.WMS( "VMap0","tilecache.cgi?",
{
        layers: 'osm',
        format: 'image/png',
});
map.addLayer(layer);


And here's my tilecache.cfg:

[osm]
type=Mapnik
mapfile=/home/eamorr/maps/mapnik/osm.xml
spherical_mercator=true
tms_type=google
metatile=yes
bbox=-10.93, 51.26, -5.21, 55.56
resolutions=156543.03390000001, 78271.516950000005, 39135.758475000002, 19567.879237500001,9783.9396187500006, 4891.9698093750003, 2445.9849046875001, 1222.9924523437501,611.49622617187504, 305.74811308593752, 152.87405654296876, 76.43702827148438, 38.21851413574219, 19.109257067871095, 9.5546285339355475, 4.7773142669677737, 2.3886571334838869, 1.1943285667419434, 0.59716428337097172, 0.29858214168548586




The map shows up, but zoomed in very close. On zooming out, I can eventually see 'Ireland' showing up on the map, but I can't move the map around and it seems to be stuck in the same position. I feel I'm very close to getting this map server working, it's just I'm completely stumped.

And help is much appreciated.

Thanks,



Eamorr wrote:
Greetings,

I've installed PostGreSQL and PostGIS and sucessfully loaded Ireland (ireland.osm) into the database.

I've tried doing the following:

source set-mapnik-env
./customize-mapnik-map > $MAPNIK_MAP_FILE
./generate_tiles.py

(I've edited set-mapnik-env and generate_tiles as appropriate)

The problem is, when I run 'generate_tiles.py' - nothing happens! No error messages, nothing, it just quits after a split-second.

I'm completely stumped and have no idea what to do now.

Could anyone give me any suggestions?

Many thanks,

Re: generate_tiles.py problem

by Eamorr () :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ok,
 
I've converted my lat/lons to spherical mercator coordinates using the functions here:

http://trac.openlayers.org/browser/trunk/openlayers/lib/OpenLayers/Layer/SphericalMercator.js#L80

In the tilecache.cfg file,
bbox=-10.93, 51.26, -5.21, 55.56
becomes
bbox=-1216722.0342011,6667414.2157046,-579974.54695222,7471318.1244976

I also changed the javascript.

Now I keep getting all these error messages associated with each tile image:
An error occurred: Current x value -903635.966401 is too far from tile corner x -900122.445725
An error occurred: Current x value -981907.483351 is too far from tile corner x -978393.962675
An error occurred: Current x value -864500.207926 is too far from tile corner x -860986.687250
etc.

It seems to me there's some sort of rounding error going on. Can't for the life of me figure out what's going on here.

Anyone have any tips?

Thanks in advance,





Eamorr wrote:
Greetings,

I've installed PostGreSQL and PostGIS and sucessfully loaded Ireland (ireland.osm) into the database.

I've tried doing the following:

source set-mapnik-env
./customize-mapnik-map > $MAPNIK_MAP_FILE
./generate_tiles.py

(I've edited set-mapnik-env and generate_tiles as appropriate)

The problem is, when I run 'generate_tiles.py' - nothing happens! No error messages, nothing, it just quits after a split-second.

I'm completely stumped and have no idea what to do now.

Could anyone give me any suggestions?

Many thanks,

Re: generate_tiles.py problem

by Dane Springmeyer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Eamorr,

Your configuration does not look quite right, and can be more simple.

I've just added a few example files for you at Mapnik-utils. See:

http://code.google.com/p/mapnik-utils/source/detail?r=787

You'll need to point the OL code at your tilecache.cgi or just use the  
provided (by tilecache) local http server which by default mounts at

http://localhost:8080

Cheers,

Dane


On Jun 23, 2009, at 6:18 AM, Eamorr wrote:

>
> Here's my javascript:
>
> var options ={
> maxResolution: "auto",
> maxExtent: new OpenLayers.Bounds(-10.93, 51.26, -5.21, 55.56),
> minResolution: "auto",
> resolutions:[156543.03390000001, 78271.516950000005,  
> 39135.758475000002,
> 19567.879237500001, 9783.9396187500006, 4891.9698093750003,
> 2445.9849046875001, 1222.9924523437501, 611.49622617187504,
> 305.74811308593752, 152.87405654296876, 76.43702827148438,
> 38.21851413574219, 19.109257067871095, 9.5546285339355475,
> 4.7773142669677737, 2.3886571334838869, 1.1943285667419434,
> 0.59716428337097172, 0.29858214168548586],
> numZoomLevels: 16,
> spherical_mercator: true
> };
>
> map = new OpenLayers.Map( $('map'), options);
> layer = new OpenLayers.Layer.WMS( "VMap0","tilecache.cgi?",
> {
>        layers: 'osm',
> format: 'image/png',
> });
> map.addLayer(layer);
>
>
> And here's my tilecache.cfg:
>
> [osm]
> type=Mapnik
> mapfile=/home/eamorr/maps/mapnik/osm.xml
> spherical_mercator=true
> tms_type=google
> metatile=yes
> bbox=-10.93, 51.26, -5.21, 55.56
> resolutions=156543.03390000001, 78271.516950000005,  
> 39135.758475000002,
> 19567.879237500001,9783.9396187500006, 4891.9698093750003,
> 2445.9849046875001, 1222.9924523437501,611.49622617187504,
> 305.74811308593752, 152.87405654296876, 76.43702827148438,
> 38.21851413574219, 19.109257067871095, 9.5546285339355475,
> 4.7773142669677737, 2.3886571334838869, 1.1943285667419434,
> 0.59716428337097172, 0.29858214168548586
>
>
>
>
> The map shows up, but zoomed in very close. On zooming out, I can  
> eventually
> see 'Ireland' showing up on the map, but I can't move the map around  
> and it
> seems to be stuck in the same position. I feel I'm very close to  
> getting
> this map server working, it's just I'm completely stumped.
>
> And help is much appreciated.
>
> Thanks,
>
>
>
>
> Eamorr wrote:
>>
>> Greetings,
>>
>> I've installed PostGreSQL and PostGIS and sucessfully loaded Ireland
>> (ireland.osm) into the database.
>>
>> I've tried doing the following:
>>
>> source set-mapnik-env
>> ./customize-mapnik-map > $MAPNIK_MAP_FILE
>> ./generate_tiles.py
>>
>> (I've edited set-mapnik-env and generate_tiles as appropriate)
>>
>> The problem is, when I run 'generate_tiles.py' - nothing happens!  
>> No error
>> messages, nothing, it just quits after a split-second.
>>
>> I'm completely stumped and have no idea what to do now.
>>
>> Could anyone give me any suggestions?
>>
>> Many thanks,
>>
>
> --
> View this message in context: http://www.nabble.com/generate_tiles.py-problem-tp23997196p24155592.html
> Sent from the Mapnik - Users mailing list archive at Nabble.com.
>
> _______________________________________________
> Mapnik-users mailing list
> Mapnik-users@...
> https://lists.berlios.de/mailman/listinfo/mapnik-users

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

Re: generate_tiles.py problem

by Eamorr :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks so much for your help. I now (finally!) have a working mapserver...

Here's my tilecache.cfg:

[cache]
type=Disk
base=/tmp/tilecache

[osm]
type=Mapnik
mapfile=/home/eamorr/maps/mapnik/osm.xml
spherical_mercator=true


And here's the html/javascript:

<head>
<style type="text/css">
html, body { height: 100%; }
body {margin: 0px;}
#map{
width: 100%;
height: 100%;
}
</style>
<script src="http://openlayers.org/api/OpenLayers.js"></script>

<script type="text/javascript">
        var map;
       
        function init() {
           
            var options = {
                maxResolution: 156543.0339,
                units: 'm',
                projection: new OpenLayers.Projection("EPSG:900913"),
                maxExtent: new OpenLayers.Bounds(-20037508.34, -20037508.34, 20037508.34, 20037508.34)
            };
           
            map = new OpenLayers.Map("map", options);
           
           
            /*              
            Works with a tilecache.cfg layer entry like:
           
            [osm]
            type=Mapnik
            mapfile=/full/path/to/osm.xml
            spherical_mercator=true
           
            **Your OSM data in postgis must be in EPSG 900913 or Spherical Mercator**
           
            Edit the below parameters to fit your setup:
           
            */

           
           
            // default url of tilecache_http_server.py
            var server_url = "http://maps.myserver.com/tilecache/tilecache.cgi?";
           
            // Must match tilecache config layername
            var layer_name = "osm";
           
            var image_type = "png";
            // force regeneration even if cache is hit
            //var image_type = "png?FORCE=1";
           
           
            var wms = new OpenLayers.Layer.WMS("TileCache Mapnik Layer",server_url,
                { serviceVersion: "1.0.0", layers: layer_name,  type: image_type });

            var official_tiles = new OpenLayers.Layer.OSM("Mapnik from OSM");
           
            map.addLayers([wms,official_tiles]);
            map.addControl(new OpenLayers.Control.Scale('scale'));
            map.addControl(new OpenLayers.Control.Navigation());
            map.addControl(new OpenLayers.Control.PanZoom());
            map.zoomToMaxExtent();
                }
</script>
</head>

<body onload="init()">
<div id="map"></div>
</body>


This may be of help to someone in future.

Best wishes from Ireland,

Eamorr




Dane Springmeyer wrote:
Eamorr,

Your configuration does not look quite right, and can be more simple.

I've just added a few example files for you at Mapnik-utils. See:

http://code.google.com/p/mapnik-utils/source/detail?r=787

You'll need to point the OL code at your tilecache.cgi or just use the  
provided (by tilecache) local http server which by default mounts at

http://localhost:8080

Cheers,

Dane


On Jun 23, 2009, at 6:18 AM, Eamorr wrote:

>
> Here's my javascript:
>
> var options ={
> maxResolution: "auto",
> maxExtent: new OpenLayers.Bounds(-10.93, 51.26, -5.21, 55.56),
> minResolution: "auto",
> resolutions:[156543.03390000001, 78271.516950000005,  
> 39135.758475000002,
> 19567.879237500001, 9783.9396187500006, 4891.9698093750003,
> 2445.9849046875001, 1222.9924523437501, 611.49622617187504,
> 305.74811308593752, 152.87405654296876, 76.43702827148438,
> 38.21851413574219, 19.109257067871095, 9.5546285339355475,
> 4.7773142669677737, 2.3886571334838869, 1.1943285667419434,
> 0.59716428337097172, 0.29858214168548586],
> numZoomLevels: 16,
> spherical_mercator: true
> };
>
> map = new OpenLayers.Map( $('map'), options);
> layer = new OpenLayers.Layer.WMS( "VMap0","tilecache.cgi?",
> {
>        layers: 'osm',
> format: 'image/png',
> });
> map.addLayer(layer);
>
>
> And here's my tilecache.cfg:
>
> [osm]
> type=Mapnik
> mapfile=/home/eamorr/maps/mapnik/osm.xml
> spherical_mercator=true
> tms_type=google
> metatile=yes
> bbox=-10.93, 51.26, -5.21, 55.56
> resolutions=156543.03390000001, 78271.516950000005,  
> 39135.758475000002,
> 19567.879237500001,9783.9396187500006, 4891.9698093750003,
> 2445.9849046875001, 1222.9924523437501,611.49622617187504,
> 305.74811308593752, 152.87405654296876, 76.43702827148438,
> 38.21851413574219, 19.109257067871095, 9.5546285339355475,
> 4.7773142669677737, 2.3886571334838869, 1.1943285667419434,
> 0.59716428337097172, 0.29858214168548586
>
>
>
>
> The map shows up, but zoomed in very close. On zooming out, I can  
> eventually
> see 'Ireland' showing up on the map, but I can't move the map around  
> and it
> seems to be stuck in the same position. I feel I'm very close to  
> getting
> this map server working, it's just I'm completely stumped.
>
> And help is much appreciated.
>
> Thanks,
>
>
>
>
> Eamorr wrote:
>>
>> Greetings,
>>
>> I've installed PostGreSQL and PostGIS and sucessfully loaded Ireland
>> (ireland.osm) into the database.
>>
>> I've tried doing the following:
>>
>> source set-mapnik-env
>> ./customize-mapnik-map > $MAPNIK_MAP_FILE
>> ./generate_tiles.py
>>
>> (I've edited set-mapnik-env and generate_tiles as appropriate)
>>
>> The problem is, when I run 'generate_tiles.py' - nothing happens!  
>> No error
>> messages, nothing, it just quits after a split-second.
>>
>> I'm completely stumped and have no idea what to do now.
>>
>> Could anyone give me any suggestions?
>>
>> Many thanks,
>>
>
> --
> View this message in context: http://www.nabble.com/generate_tiles.py-problem-tp23997196p24155592.html
> Sent from the Mapnik - Users mailing list archive at Nabble.com.
>
> _______________________________________________
> Mapnik-users mailing list
> Mapnik-users@lists.berlios.de
> https://lists.berlios.de/mailman/listinfo/mapnik-users

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

Re: generate_tiles.py problem

by Dane Springmeyer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Eamorr,

It is important that you send a new email with a new subject title  
that clearly states what you are needing to know.

I sense that you had an osm2pgsql problem and now you are trying to  
set up TileCache.

Please resend a new, clearer email!

Thanks,

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

Re: generate_tiles.py problem

by Artem Pavlenko-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Eamorr,
Please, consider subscribing to mapnik-users.
Regards,
Artem

2009/6/22 Eamorr <eamonn@...>:

>
> Ok,
>
> I've converted my lat/lons to spherical mercator coordinates using the
> functions here:
>
> http://trac.openlayers.org/browser/trunk/openlayers/lib/OpenLayers/Layer/SphericalMercator.js#L80
>
> In the tilecache.cfg file,
> bbox=-10.93, 51.26, -5.21, 55.56
> becomes
> bbox=-1216722.0342011,6667414.2157046,-579974.54695222,7471318.1244976
>
> I also changed the javascript.
>
> Now I keep getting all these error messages associated with each tile image:
> An error occurred: Current x value -903635.966401 is too far from tile
> corner x -900122.445725
> An error occurred: Current x value -981907.483351 is too far from tile
> corner x -978393.962675
> An error occurred: Current x value -864500.207926 is too far from tile
> corner x -860986.687250
> etc.
>
> It seems to me there's some sort of rounding error going on. Can't for the
> life of me figure out what's going on here.
>
> Anyone have any tips?
>
> Thanks in advance,
>
>
>
>
>
>
> Eamorr wrote:
>>
>> Greetings,
>>
>> I've installed PostGreSQL and PostGIS and sucessfully loaded Ireland
>> (ireland.osm) into the database.
>>
>> I've tried doing the following:
>>
>> source set-mapnik-env
>> ./customize-mapnik-map > $MAPNIK_MAP_FILE
>> ./generate_tiles.py
>>
>> (I've edited set-mapnik-env and generate_tiles as appropriate)
>>
>> The problem is, when I run 'generate_tiles.py' - nothing happens! No error
>> messages, nothing, it just quits after a split-second.
>>
>> I'm completely stumped and have no idea what to do now.
>>
>> Could anyone give me any suggestions?
>>
>> Many thanks,
>>
>
> --
> View this message in context: http://www.nabble.com/generate_tiles.py-problem-tp23997196p24156088.html
> Sent from the Mapnik - Users mailing list archive at Nabble.com.
>
> _______________________________________________
> Mapnik-users mailing list
> Mapnik-users@...
> https://lists.berlios.de/mailman/listinfo/mapnik-users
>
_______________________________________________
Mapnik-users mailing list
Mapnik-users@...
https://lists.berlios.de/mailman/listinfo/mapnik-users