This is what happened after reprojecting all OSM data in Postgis by
update gosm_point set way=transform(way,32635);
update gosm_line set way=transform(way,32635);
update gosm_polygon set way=transform(way,32635);
update geometry_columns set srid=32635 where f_table_name='gosm_point';
update geometry_columns set srid=32635 where f_table_name='gosm_line';
update geometry_columns set srid=32635 where f_table_name='gosm_polygon';
and editing osm.xml to suit the new epsg:32635 projection by having in all
places
srs="+proj=utm +zone=35 +ellps=WGS84 +datum=WGS84 +units=m +no_defs"
C:\mapnik>c:\python2.5\python nik2img.py -m nik2img.xml -o niktest2.png -p epsg
:32635 -r 389725,6673682,392528,6676266 -s 2803,2584 -v
STEP: 0 // --> Confirmed path to XML mapfile: nik2img.xml
STEP: 1 // --> Custom dimensions requested of 2803 (width), and 2584 (height) pi
xels
STEP: 2 // --> Loaded mapnik python bindings
Total time: 0.066999912262 seconds | Last step: 0.0 seconds
STEP: 3 // --> Map object created successfully
Total time: 0.066999912262 seconds | Last step: 0.0 seconds
STEP: 4 // --> XML mapfile loaded successfully
Total time: 0.776999950409 seconds | Last step: 0.0 seconds
STEP: 5 // --> Reprojecting map output
Total time: 0.77999997139 seconds | Last step: 0.0 seconds
STEP: 6 // --> Mapnik projection successfully initiated with epsg code: '+init=e
psg:32635'
Total time: 0.842000007629 seconds | Last step: 0.0 seconds
STEP: 7 // --> BBOX is: Envelope(389725.0,6673682.0,392528.0,6676266.0)
Total time: 0.842000007629 seconds | Last step: 0.0 seconds
STEP: 8 | --> WARNING: Map layer 'places' does not intersect with Map envelope,
skipping details
STEP: 9 // --> Map layer 'admin' intersects Map envelope
Total time: 0.84500002861 seconds | Last step: 0.0 seconds
STEP: 10 // --> Map layer 'admin' intersects Map envelope
Total time: 0.846999883652 seconds | Last step: 0.0 seconds
STEP: 11 // --> Map layer 'power' intersects Map envelope
Total time: 0.849999904633 seconds | Last step: 0.0 seconds
STEP: 12 // --> Map layer 'power' intersects Map envelope
Total time: 0.851999998093 seconds | Last step: 0.0 seconds
STEP: 13 // --> Map layer 'text' intersects Map envelope
Total time: 0.851999998093 seconds | Last step: 0.0 seconds
STEP: 14 // --> Map layer 'text' intersects Map envelope
Total time: 0.856999874115 seconds | Last step: 0.0 seconds
STEP: 15 // --> Map layer 'area-text' intersects Map envelope
Total time: 0.859999895096 seconds | Last step: 0.0 seconds
STEP: 16 // --> Map layer 'area-text' intersects Map envelope
Total time: 0.859999895096 seconds | Last step: 0.0 seconds
STEP: 17 // --> Map layer 'planet roads text osm' intersects Map envelope
Total time: 0.861999988556 seconds | Last step: 0.0 seconds
STEP: 18 // --> Map layer 'planet roads text osm' intersects Map envelope
Total time: 0.865000009537 seconds | Last step: 0.0 seconds
STEP: 19 // --> Map layer 'amenity' intersects Map envelope
Total time: 0.865000009537 seconds | Last step: 0.0 seconds
STEP: 20 // --> Map layer 'amenity' intersects Map envelope
Total time: 0.867000102997 seconds | Last step: 0.0 seconds
STEP: 21 // --> Map layer 'roads' intersects Map envelope
Total time: 0.869999885559 seconds | Last step: 0.0 seconds
STEP: 22 // --> Map layer 'roads' intersects Map envelope
Total time: 0.869999885559 seconds | Last step: 0.0 seconds
STEP: 23 // --> Map layer 'minor-roads' intersects Map envelope
Total time: 0.871999979019 seconds | Last step: 0.0 seconds
STEP: 24 // --> Map layer 'minor-roads' intersects Map envelope
Total time: 0.871999979019 seconds | Last step: 0.0 seconds
STEP: 25 // --> Map layer 'tunnels' intersects Map envelope
Total time: 0.875 seconds | Last step: 0.0 seconds
STEP: 26 // --> Map layer 'tunnels' intersects Map envelope
Total time: 0.87700009346 seconds | Last step: 0.0 seconds
STEP: 27 // --> Map layer 'waterway' intersects Map envelope
Total time: 0.87700009346 seconds | Last step: 0.0 seconds
STEP: 28 // --> Map layer 'waterway' intersects Map envelope
Total time: 0.879999876022 seconds | Last step: 0.0 seconds
STEP: 29 // --> Map layer 'water' intersects Map envelope
Total time: 0.879999876022 seconds | Last step: 0.0 seconds
STEP: 30 // --> Map layer 'water' intersects Map envelope
Total time: 0.881999969482 seconds | Last step: 0.0 seconds
STEP: 31 // --> Map layer 'leisure' intersects Map envelope
Total time: 0.881999969482 seconds | Last step: 0.0 seconds
STEP: 32 // --> Map layer 'leisure' intersects Map envelope
Total time: 0.884999990463 seconds | Last step: 0.0 seconds
STEP: 33 // --> Map layer 'builtup' intersects Map envelope
Total time: 0.887000083923 seconds | Last step: 0.0 seconds
STEP: 34 // --> Map layer 'builtup' intersects Map envelope
Total time: 0.887000083923 seconds | Last step: 0.0 seconds
STEP: 35 // --> Map layer 'coast-poly' intersects Map envelope
Total time: 0.889999866486 seconds | Last step: 0.0 seconds
STEP: 36 // --> Map layer 'coast-poly' intersects Map envelope
Total time: 0.889999866486 seconds | Last step: 0.0 seconds
STEP: 37 // --> Map layer 'world' intersects Map envelope
Total time: 0.891999959946 seconds | Last step: 0.0 seconds
STEP: 38 // --> Map layer 'world' intersects Map envelope
Total time: 0.894999980927 seconds | Last step: 0.0 seconds
STEP: 39 // --> Map layer 'world-1' intersects Map envelope
Total time: 0.894999980927 seconds | Last step: 0.0 seconds
STEP: 40 // --> Map layer 'world-1' intersects Map envelope
Total time: 0.897000074387 seconds | Last step: 0.0 seconds
STEP: 41 // --> Map rendered to 'niktest2.png'
Total time: 3.24000000954 seconds | Last step: 0.0 seconds
STEP: 42 // --> Completed, opening 'niktest2.png' <=============================
=========================='
Total time: 3.53699994087 seconds | Last step: 0.0 seconds
PostgreSQL log collect queries like
2008-10-27 21:32:57 LOG: execute <unnamed>: select asbinary(way) as
geom,"highway","tunnel" from (select * from gosm_line order by z_order) as
roads where way && setSRID('BOX3D(392527.9999999671 6673681.999999999,500000
6676265.999999509)'::box3d,32635)
-Jukka-
-----Alkuperäinen viesti-----
Lähettäjä: Rahkonen Jukka
Lähetetty: ma 27.10.2008 20:35
Vastaanottaja: Dane Springmeyer
Kopio: Martijn van Oosterhout; mapnik mailinglist
Aihe: Re: [Mapnik-users] Question about nik2img.py
Hi,
I downloaded nik2img on Saturday, file name is nik2img-0_1_0.tar.
PostgreSQL version is 8.2
PostGIS version is 1.3.2 for PostgreSQL 8.2.
I noticed that my PostGIS was missing epsg:900913 in spatial_ref_sys table so I
added it there.
Then I renewed my test by downloading last nights Finland.osm.bz2 from
Geofabrik. I installed it by running osm2pgsql.exe with -m switch and next I
run nik2img.py. Command and console listing follows. Adding epsg:900913
definitions may have had some effect on the SQL gathered into PostgreSQL log
file, but the resulting maps do look exactly the same as yesterday and OSM
vectors are missing from the western side of the maps.
C:\mapnik>c:\python2.5\python nik2img.py -m gosm.xml -o niktest2.png -p
epsg:32635
-r 389725,6673682,392528,6676266 -s 2803,2584 -v
STEP: 0 // --> Confirmed path to XML mapfile: gosm.xml
STEP: 1 // --> Custom dimensions requested of 2803 (width), and 2584 (height) pi
xels
STEP: 2 // --> Loaded mapnik python bindings
Total time: 0.140999794006 seconds | Last step: 0.0 seconds
STEP: 3 // --> Map object created successfully
Total time: 0.140999794006 seconds | Last step: 0.0 seconds
STEP: 4 // --> XML mapfile loaded successfully
Total time: 0.84299993515 seconds | Last step: 0.0 seconds
STEP: 5 // --> Reprojecting map output
Total time: 0.84299993515 seconds | Last step: 0.0 seconds
STEP: 6 // --> Mapnik projection successfully initiated with epsg code: '+init=e
psg:32635'
Total time: 0.90499997139 seconds | Last step: 0.0 seconds
STEP: 7 // --> BBOX is: Envelope(389725.0,6673682.0,392528.0,6676266.0)
Total time: 0.90499997139 seconds | Last step: 0.0 seconds
STEP: 8 | --> WARNING: Map layer 'places' does not intersect with Map envelope,
skipping details
STEP: 9 // --> Map layer 'admin' intersects Map envelope
Total time: 0.90499997139 seconds | Last step: 0.0 seconds
STEP: 10 // --> Map layer 'admin' intersects Map envelope
Total time: 0.90499997139 seconds | Last step: 0.0 seconds
STEP: 11 // --> Map layer 'power' intersects Map envelope
Total time: 0.90499997139 seconds | Last step: 0.0 seconds
STEP: 12 // --> Map layer 'power' intersects Map envelope
Total time: 0.90499997139 seconds | Last step: 0.0 seconds
STEP: 13 // --> Map layer 'text' intersects Map envelope
Total time: 0.921000003815 seconds | Last step: 0.0 seconds
STEP: 14 // --> Map layer 'text' intersects Map envelope
Total time: 0.921000003815 seconds | Last step: 0.0 seconds
STEP: 15 // --> Map layer 'area-text' intersects Map envelope
Total time: 0.921000003815 seconds | Last step: 0.0 seconds
STEP: 16 // --> Map layer 'area-text' intersects Map envelope
Total time: 0.921000003815 seconds | Last step: 0.0 seconds
STEP: 17 // --> Map layer 'planet roads text osm' intersects Map envelope
Total time: 0.921000003815 seconds | Last step: 0.0 seconds
STEP: 18 // --> Map layer 'planet roads text osm' intersects Map envelope
Total time: 0.921000003815 seconds | Last step: 0.0 seconds
STEP: 19 // --> Map layer 'amenity' intersects Map envelope
Total time: 0.921000003815 seconds | Last step: 0.0 seconds
STEP: 20 // --> Map layer 'amenity' intersects Map envelope
Total time: 0.921000003815 seconds | Last step: 0.0 seconds
STEP: 21 // --> Map layer 'roads' intersects Map envelope
Total time: 0.921000003815 seconds | Last step: 0.0 seconds
STEP: 22 // --> Map layer 'roads' intersects Map envelope
Total time: 0.9359998703 seconds | Last step: 0.0 seconds
STEP: 23 // --> Map layer 'minor-roads' intersects Map envelope
Total time: 0.9359998703 seconds | Last step: 0.0 seconds
STEP: 24 // --> Map layer 'minor-roads' intersects Map envelope
Total time: 0.9359998703 seconds | Last step: 0.0 seconds
STEP: 25 // --> Map layer 'tunnels' intersects Map envelope
Total time: 0.9359998703 seconds | Last step: 0.0 seconds
STEP: 26 // --> Map layer 'tunnels' intersects Map envelope
Total time: 0.9359998703 seconds | Last step: 0.0 seconds
STEP: 27 // --> Map layer 'waterway' intersects Map envelope
Total time: 0.9359998703 seconds | Last step: 0.0 seconds
STEP: 28 // --> Map layer 'waterway' intersects Map envelope
Total time: 0.9359998703 seconds | Last step: 0.0 seconds
STEP: 29 // --> Map layer 'water' intersects Map envelope
Total time: 0.9359998703 seconds | Last step: 0.0 seconds
STEP: 30 // --> Map layer 'water' intersects Map envelope
Total time: 0.951999902725 seconds | Last step: 0.0 seconds
STEP: 31 // --> Map layer 'leisure' intersects Map envelope
Total time: 0.951999902725 seconds | Last step: 0.0 seconds
STEP: 32 // --> Map layer 'leisure' intersects Map envelope
Total time: 0.951999902725 seconds | Last step: 0.0 seconds
STEP: 33 // --> Map layer 'builtup' intersects Map envelope
Total time: 0.951999902725 seconds | Last step: 0.0 seconds
STEP: 34 // --> Map layer 'builtup' intersects Map envelope
Total time: 0.951999902725 seconds | Last step: 0.0 seconds
STEP: 35 // --> Map layer 'coast-poly' intersects Map envelope
Total time: 0.951999902725 seconds | Last step: 0.0 seconds
STEP: 36 // --> Map layer 'coast-poly' intersects Map envelope
Total time: 0.951999902725 seconds | Last step: 0.0 seconds
STEP: 37 // --> Map layer 'world' intersects Map envelope
Total time: 0.951999902725 seconds | Last step: 0.0 seconds
STEP: 38 // --> Map layer 'world' intersects Map envelope
Total time: 0.951999902725 seconds | Last step: 0.0 seconds
STEP: 39 // --> Map layer 'world-1' intersects Map envelope
Total time: 0.951999902725 seconds | Last step: 0.0 seconds
STEP: 40 // --> Map layer 'world-1' intersects Map envelope
Total time: 0.951999902725 seconds | Last step: 0.0 seconds
STEP: 41 // --> Map rendered to 'niktest2.png'
Total time: 3.88499999046 seconds | Last step: 0.0 seconds
STEP: 42 // --> Completed, opening 'niktest2.png' <=============================
=========================='
Total time: 4.11899995804 seconds | Last step: 0.0 seconds
PostgreSQL log collect queries like this
2008-10-27 20:30:44 LOG: execute <unnamed>: select asbinary(way) as
geom,"aeroway","bridge","highway","layer","railway","route","tunnel" from
(select * from gosm_line order by z_order) as roads where way &&
setSRID('BOX3D(2789746.485574467 8415997.771967711,3648334.852878307
8446637.283174304)'::box3d,900913)
-Jukka-
Dane Springmeyer wrote:[mailto:[EMAIL PROTECTED]
Lähetetty: ma 27.10.2008 19:51
Vastaanottaja: Rahkonen Jukka
Kopio: Martijn van Oosterhout; mapnik mailinglist
Aihe: Re: [Mapnik-users] Question about nik2img.py
Jukka,
I may have spoke to soon in the sense that the reprojection of the
bbox inside the nik2img script before passing parameters along to
mapnik may not be your only problem.
I'll need to set up a test case and do further testing because I get
different results than you. The bbox set with the -r flag get properly
passed to mapnik on my system but the -p flag to actually request the
map in the UTM projection is not being honored.
When I get around to testing it would be helpful to know what versions
of nik2img and postgres/postgis are you using.
Also, note that you should use the '-v' flag to output verbose debug
information from nik2img which might yield more clues about what is
going wrong.
Dane
On Oct 27, 2008, at 5:36 AM, Rahkonen Jukka wrote:
> Martijn van Oosterhout wrote:
>
>> On Mon, Oct 27, 2008 at 10:59 AM, Rahkonen Jukka
>> <[EMAIL PROTECTED]> wrote:
>>> I wonder if nik2img could be made to support this kind of
>> cases properly. There is no need to reproject the bbox of
>> request because now the request and data are using the same
>> projection. Thus the coordinates could perhaps just be passed
>> on to the database query as they are given in the command line?
>>> So instead of these parameters
>>> -r 389725,6673682,392528,6676266
>>> which now lead to database query
>>> setSRID('BOX3D(392527.9999999671 6673681.999999999,500000
>>> 6676265.999999509)'::box3d,32635)
>>> the query might be simply
>>> BOX3D(389725 6673682,392528 6676266)
>>
>> Do you realise that setSRID does not do any projection at all
>> and that from the point of view of the database those queries
>> will return exactly the same thing?
>>
>> What you probably intend is the query to be somethinhg like:
>>
>> st_transform( setSRID('BOX3D(392527.9999999671
>> 6673681.999999999,500000 6676265.999999509)'::box3d,32635), 900913)
>
> Thanks Martijn, I checked the database logs after well behaving
> queries
> sent by other clients and saw that there is not much wrong in the
> query
> sent by nik2img-Mapnin chain. My database is now in 32635 and
> st_transform is not needed. Therefore
> setSRID('BOX3D(392527.9999999671
> 6673681.999999999,500000 6676265.999999509)'::box3d,32635) is
> otherwise
> OK, but for some reason it does not take the easting parameters as I
> give those. MaxX parameter 392528 is used as MinX (after going
> through
> some rather accurate calculation) and static value 500000 is used as
> MaxX. For me this looks like a bug either in the script or in Mapnik
> but perhaps I am giving the parameters wrongly. According to nik2img
> help -r 389725,6673682,392528,6676266 should be correct.
>
> Should I try running Mapnik-WMS instead of nik2img? I would prefer
> using
> nik2img because I just want to get Mapnik maps which I could
> georeference simply and accurately to be used in GIS programs. And I
> have already both Mapserver and Geoserver WMS running on this
> computer.
> But I can tolerate having a third WMS if that is the way to go. Most
> fresh Mapnik Windows version seems to be 0.5.1, is it enough for
> running
> WMS service?
>
> -Jukka Rahkonen-
> _______________________________________________
> Mapnik-users mailing list
> [email protected]
> https://lists.berlios.de/mailman/listinfo/mapnik-users
_______________________________________________
Mapnik-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mapnik-users