On Thu, Mar 20, 2008 at 10:32 AM, Rahkonen Jukka
<[EMAIL PROTECTED]> wrote:
> 1. Have I understood right, that in the OSM.XML file, in the layer object,
> the actual projection where the data are in database or shapefile, is given?
> For  example, this layer is originally in spherical mercator, or Google
> mercator, or epsg:900913:
>  <Layer name="power" 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">

Correct...

> 2. In the same layer object I can either let PostGIS to estimate the
> geographical extents of the layer (="estimate_extent">true), or I can give
> the extents myself by using the same units that the original data source is
> using
>  <Parameter name="estimate_extent">false</Parameter>
>       <Parameter
> name="extent">-20037508,-19929239,20037508,19929239</Parameter>
> Is this right?

Or leave out both and the mapnik will always query the layer.
estimate_extent doesn't work very well apparently and if you're
covering the whole world anyway you're not going to save any useful
amount of work by giving an extent.

> 3. The output projection of the resulting map is defined in the beginning of
> the OSM.XML file
> <Map bgcolor="#b5d0d0" 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">
> In this case the output is in spherical marcator, but I should be able to
> change it to Finnish KKJ, Zone 3 (epsg:2393) by defining:
> <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 +no_defs">
> Correct?

Correct.

> 4. What generate_image.py is actually doing, is
> - Tell Mapnik program to take further instructions from environment variable
> MAPNIK_MAP_FILE which can be set in Windows with command SET, and if that
> does not exist file named osm.xml.
> - Pass the size of the resulting image to Mapnik program with imgx and imgy
> variables.
> - Tell Mapnik to zoom to bounding box that is defined, in the output
> projection, with vabiable "bbox"
> - And finally render the zoomed box out to image file.
> - The projection definition in generate_image.py, as well as prj.forward
> stuff in needed because in this script the user is asked to give the extents
> of the resulting map in lon-lat bounding box, and this has to be converted
> first to "bbox" that is using the units as in the output projection.
> Am I still tuned?

Looks right...

> 5.  Finally, if I have defined the srs of the output map to Finnish KKJ in
> the osm.xml file as before in number 3, I thought I possibly could give the
> extents of the resulting map directly by writing the coordinate array in KKJ
> projection inside the bbox = Envelope().  Naturally commenting out some
> previous lines where the envelope gets calculated from lon-lat coordinates.
> Is my theory correct?

Yes, though make sure you get the lat/lon <-> X/Y order correct.

> 6. I tried blindly to feed in KKJ coordinates both into Envelope() and also
> directly to m.zoom_to_box(bbox) but with no success.  All I get back are
> error messages telling me that I am feeding in numbers whith are of format
> integer, or real or something else, depending on how I wrote the
> coordinates, but not as DOUBLE which is the type that some C++ code is only
> willing to eat.
> Is there some simple way to modify generate_image.py in such a way that I
> could get the coordinates I give to passed on as DOUBLE for the Mapnik for
> Windows?

Can't answer this question without seeing the code you tried to run.
Can you paste the changed bits that failed?

Have a nice day,
-- 
Martijn van Oosterhout <[EMAIL PROTECTED]> http://svana.org/kleptog/
_______________________________________________
Mapnik-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mapnik-users

Reply via email to