Lähettäjä: Martijn van Oosterhout
On Fri, Mar 21, 2008 at 7:54 PM, Rahkonen Jukka
<[EMAIL PROTECTED]> wrote:
>> I tried to give in generate_image.py a box sized 1000 by 1000 meters in
>> Finnish KKJ projection directly by inserting minX, minY, maxX, maxY values
>> inside Envelope.
>>
>> bbox = Envelope(3376400,6672200,3377400,6673200)
> Well, I converted it on the command line and got the almost same
> results as mapnik. Convert to latlon gives me:
> 24d46'19.285"E 60d8'34.01"N and
> 24d47'21.864"E 60d9'7.383"N
> Does that seem reasonable?
By looking with bare eyes, yes, is seems reasonable.
>> <Map bgcolor="#b5d0d0" srs="+proj=tmerc +lat_0=0 +lon_0=27 +k=1.000000
>> +x_0=3500000 +y_0=0 +ellps=intl
>> +towgs84=-90.7,-106.1,-119.2,4.09,0.218,-1.05,1.37 +units=m">
> What EPSG code is this BTW, I don't spot it immediately in my
> spatial_ref_sys, though 2393 is close (doesn't have the towgs84
> parameter).
Nasty thing with epsg:2393 is that because there are different towgs84
parameters hanging around the proj4 comes by default with no towgs84 parameters
at all. That leads _always_ to more than 100 meter location error when
projecting to WGS84 and via that to any other projection. I am usually using
the towgs84 parameters that can be found in ESRI definitions which are also
shipped with proj4, at least in FWTools and MS4W packages. PostGIS has the
same issue, spatial reference system table MUST be updated before reprojecting
anything from/to the Finnish KKJ zones. The only thing that works is projectin
between different KKJ zones, because they all are missing the towgs84
parameters.
>> What hits PostGIS when running generate_image.py is like this:
>> select asbinary(way) as geom from (select way from shoreline_a) as
>> "coast-poly" where way && setSRID('BOX3D(2759544.121025309
>> 8407730.793307768,3647111.662483945 8433668.39815172)'::box3d,900913)
> From the commandline I get (something like, depends on which corners you
> take):
> 2757541.46 8431595.24, 2759611.16 8433600.95
That does not look bad to me.
> What projection do you have in the Layer tag?
It is basically the osm.xml file downloaded from svn.openstreetmap. I have
changed database connection things, some paths, and the Map level projection
definition as discussed above. Database layers are thus all like this:
<Layer name="planet roads text osm" status="on" srs="+proj=merc +a=6378137
+b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m [EMAIL
PROTECTED] +no_defs +over">
>> I have used the same proj4 strings in osm.xml as I always use with Finnish
>> KKJ so they should be correct. I suspect that I should't give KKJ
>> coordinates for Envelope.
> The envelope has ot be in the same proejction as the how you want the
> map projected... If you want it in KKJ you ned the coordinates in KKJ,
> though you can give them in something else and convert to KKJ
> obviously....
So I ought to be doing just the right thing when giving
bbox = Envelope(3376400,6672200,3377400,6673200)?
However, obviously something goes wrong before the database is queried. Have I
ane way to debug is further by myself? Can I somehow check what gets feeded
into bbox, or is it anything human readable at all?
> Have a nice day,
Thanks, eagerly awaiting for nice maps as well.
_______________________________________________
Mapnik-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mapnik-users