Hello,

i tried another way and added this part to the osm.xml that i use to describe
the map (as the first Layer):

<Layer name="bground_east" status="on" lox="0.0" loy="-85.0511" hix="180.0" 
hiy="85.0511" 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 +nadgri...@null +no_defs +over">
    <StyleName>world</StyleName>
    <Datasource>
      <Parameter name="type">raster</Parameter>
      <Parameter 
name="file">/local/vid/earth/land_shallow_topo_east.tif</Parameter>
      <Parameter name="lox">0.0</Parameter>
      <Parameter name="loy">-85.0511</Parameter>
      <Parameter name="lox">180.0</Parameter>
      <Parameter name="lox">85.0511</Parameter>
    </Datasource>
</Layer>

Though i've put lox, loy, hix and hiy in there twice i get this error:

<mapnik._mapnik.Layer object at 0x7f54404b56d8>
Traceback (most recent call last):
  File "./generate_image.py", line 62, in <module>
    load_map(m, mapfile)
UserWarning: <lox> <loy> <hix> <hiy> are required in layer 'bground_east'


Did i misconfigure something?  Or is it a bug?



Another issue:
I'd like to make the layer "world" invisible, just display the borders.  So i
tried several changes to the Style "world", it seems that there is no way to
tell the PolygonSymbolizer to NOT fill its content, right?

So i changed over to a LineSymbolizer:

      <LineSymbolizer>
        <CssParameter name="stroke">purple</CssParameter>
        <CssParameter name="stroke-width">1.0</CssParameter>
        <CssParameter name="stroke-opacity">1.0</CssParameter>
      </LineSymbolizer>

But now not only the outline is drawn but there are also lines in the Polygon
and it seems they are intended (to simulate filling the Polygon?).

Is there a way to only draw the outline of a Polygon?


Best regards,
Torsten.


> Hello,
>
> i once downloaded two huge TIF from the Nasa web server, they are called
> land_shallow_topo_east.tif and land_shallow_topo_west.tif.
>
> I'd like to use these files as background when rendering a map, so i tried
> in a modified version of OSM's generate_image.py to add a layer for the
> east TIF.  I've also set the background in "osm.xml" to "transparent".
>
> The TIF data are not rendered, though.  I have copied the python script
> that i use for this at the end of this mail.
>
> Can anybody tell me what is going wrong here?
>
> Has anybody else used these files as background?
>
> Is there a better way to use these TIFs as background?
>
> Can anybody confirm / correct the projection data that i need to use for
> the TIFs from the Nasa server?
>
>
> Best regards,
> Torsten.
>
>
>
> #!/usr/bin/python
>
> # source set-mapnik-environment
>
>
> #<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 +nadgri...@null +no_defs +over">
> #<Map bgcolor="transparent" 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 +nadgri...@null
> +no_defs +over">
>
> from mapnik import *
> import sys, os
>
> if __name__ == "__main__":
>     mapfile = "osm_print.xml"
>     map_uri = "image.png"
>
>     tifdir = "/local/vid/earth"
>     west = "land_shallow_topo_west.tif"
>     east = "land_shallow_topo_east.tif"
>
>
> #    ll = (4.5, 46, 16, 56) # Deutschland
>     ll = (-180.0, -85.0511, 180.0, 85.0511) # Welt, maximum
> #    ll = (-180.0, -50.0, 180.0, 60.0) # Welt, aspect ration 4:3
>
>     z = 10
>     imgx = 600 * z
>     imgy = 300 * z
>
>     m = Map(imgx, imgy)
>
>     r_east = Raster(base = tifdir, file = east, lox = 0.0, loy = -85.0511,
> hix = 180.0, hiy = 85.0511)
>     l_east = Layer('tif_east')
>     l_east.datasource = r_east
>
>     r_west = Raster(base = tifdir, file = west, lox = 0.0, loy = -85.0511,
> hix = 180.0, hiy = 85.0511)
>     l_west = Layer('tif_west')
>     l_west.datasource = r_west
>
>     l_east.active = True
>     print l_east
>
>     m.layers.append(l_east)
>
>     load_map(m, mapfile)
>
>     for l in m.layers:
>         print l.name
>
>     prj = Projection("+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 +nadgri...@null +no_defs +over")
>     c0 = prj.forward(Coord(ll[0], ll[1]))
>     c1 = prj.forward(Coord(ll[2], ll[3]))
>     bbox = Envelope(c0.x, c0.y, c1.x, c1.y)
>
>     m.zoom_to_box(bbox)
>
>     print "scale", m.scale(), 1.0 / m.scale()
>     print "denom", m.scale_denominator()
>
>     im = Image(imgx, imgy)
>     render(m, im)
>     view = im.view(0, 0, imgx, imgy)
>     view.save(map_uri, 'png')
>
> _______________________________________________
> 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

Reply via email to