Hi all -- I installed Mapnik 0.5.1 last week, and I got the demo from
the first tutorial up and running without any problems. But when I try
to render an image of a shapefile I have, rather than the tutorial
world map, I only get a blank image with whatever background color I
set.

I'm not getting any errors, and when I print out the bounding box, I
get the correct values, but nothing's showing in the image. I have
similar problems when I try to render PostGIS data, but I thought I'd
go back to this because it'd be simpler for a first test. Any
suggestions?


>From ogrinfo:
%ogrinfo -so County.shp County
INFO: Open of `County.shp'
      using driver `ESRI Shapefile' successful.

Layer name: County
Geometry: Polygon
Feature Count: 1
Extent: (1120580.083133, 565954.583063) - (1282212.833206, 748119.250305)
Layer SRS WKT:
PROJCS["NAD_1983_StatePlane_Maryland_FIPS_1900_Feet",
   GEOGCS["GCS_North_American_1983",
       DATUM["North_American_Datum_1983",
           SPHEROID["GRS_1980",6378137.0,298.257222101]],
       PRIMEM["Greenwich",0.0],
       UNIT["Degree",0.0174532925199433]],
   PROJECTION["Lambert_Conformal_Conic_2SP"],
   PARAMETER["False_Easting",1312333.333333333],
   PARAMETER["False_Northing",0.0],
   PARAMETER["Central_Meridian",-77.0],
   PARAMETER["Standard_Parallel_1",38.3],
   PARAMETER["Standard_Parallel_2",39.45],
   PARAMETER["Latitude_Of_Origin",37.66666666666666],
   UNIT["Foot_US",0.3048006096012192]]


<----------->

#!/usr/bin/python
from mapnik import *

m = Map(1024,1024,"+proj=lcc +datum=NAD83")

m.background = Color('steelblue')

s = Style()

r = Rule()

r.symbols.append(PolygonSymbolizer(Color('red')))
r.symbols.append(LineSymbolizer(Color('black'), 0.1))
s.rules.append(r)

m.append_style('co_style', s)

lyr = Layer('County')
lyr.datasource = Shapefile(file='./County')
lyr.styles.append('co_style')

m.layers.append(lyr)
m.zoom_to_box(lyr.envelope())
print lyr.envelope()
#outputs Envelope(1120580.08313,565954.583063,1282212.83321,748119.250305)

render_to_file(m, 'county.png', 'png')

exit()

<---------->

Cheers,
Justin


--
"News is what people want to keep hidden, and everything else is publicity"
--Bill Moyers
_______________________________________________
Mapnik-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mapnik-users

Reply via email to