Hello,
North coordinate is OK now, but this time west coordinate gets uncorrectly
slided to the left. One more trial with plus and minus should correct it
finally:
upper_left_x_center = extent.minx+(scale/2.0)
upper_left_y_center = extent.maxy-(scale/2.0)
Your code will work on southern hemisphere too, but text leads to think that
there may a minory misunderstanding still. There reads:
A world file file is a plain ASCII text file consisting of six values separated
by newlines. The format is:
pixel X size
rotation about the Y axis (usually 0.0)
rotation about the X axis (usually 0.0)
negative pixel Y size
X coordinate of upper left pixel center
Y coordinate of upper left pixel center
Fourth line is NOT always negative pixel Y size. It is negative if Y
coordinate is decreasing when image is read from top to bottom. In southern
hemisphere it must be positive. It depends naturally on the projection as well.
-Jukka-
-----Alkuperäinen viesti-----
Lähettäjä: Dane Springmeyer [mailto:[EMAIL PROTECTED]
Lähetetty: ke 29.10.2008 1:42
Vastaanottaja: Rahkonen Jukka
Kopio: Mapnik users mailing-list
Aihe: Re: [Mapnik-users] Nik2img.py success
Jukka,
Okay, thanks again for testing.
Try again now: http://code.google.com/p/mapnik-utils/source/detail?r=251
Dane
On Oct 28, 2008, at 2:59 PM, Rahkonen Jukka wrote:
> Hi,
>
> I made three quick tests
>
>
> 1) Output 5000x5000 pixels, pixel size 1 meters -> pgw file with
> correct pixel size, error in north coordinate
> 2) Output 2500x2500 pixels, pixel size 2 meters -> pgw file with
> correct pixel size, error in north coordinate
> 3) Output 5000x2500 pixels, pixel size 2 meters -> not sure about
> the result yet
>
> Result is OK for all, except that half-a-pixel sliding of north
> coordinate goes to wrong direction. I suppose you did it
> intentionally to see if I am awake :)
>
> -Jukka-
>
> -----Alkuperäinen viesti-----
> Lähettäjä: Dane Springmeyer [mailto:[EMAIL PROTECTED]
> Lähetetty: ti 28.10.2008 20:28
> Vastaanottaja: Rahkonen Jukka
> Kopio: Mapnik users mailing-list
> Aihe: Re: [Mapnik-users] Nik2img.py success
>
> Jukka,
>
> Thats good to hear.
>
> It was on my list to add world file support to nik2img.py and I've
> committed beta support in r250
> (http://code.google.com/p/mapnik-utils/source/detail?r=250
> )
>
> Therefore to try automatic generate of your world files try:
> $ nik2img.py -m nik2img_noextent.xml -o niktest2.png -p epsg:32635 -r
> 391000,6673000,396000,6678000 -s 5000,5000 --worldfile pgw
>
> Dane
>
>
> On Oct 28, 2008, at 9:53 AM, Rahkonen Jukka wrote:
>
>> Hi,
>>
>> I converted OSM data in the database into epsg:32635, edited osm.xml
>> to use this projection, removed the extent lines from osm.xml and
>> run the following command:
>>
>> C:\mapnik>c:\python2.5\python nik2img.py -m nik2img_noextent.xml -o
>> niktest2.png
>> -p epsg:32635 -r 391000,6673000,396000,6678000 -s 5000,5000 -v
>>
>> I wrote corresponding world file niktest2.pgw as
>>
>> 1.0000
>> 0.0000
>> 0.0000
>> -1.0000
>> 391000
>> 6678000
>>
>> Mapnik map is full of OSM vector data and it can be overlaid with
>> other maps and aerial photos from WMS service. I am satisfied,
>> finally I can use OSM maps in GIS. I think that some day I will
>> prepare a set of OSM maps which are ready to be used with
>> OziExplorer moving map software. Thanks for the developers.
>>
>> -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