Thanks, David.

I dug a bit deeper into ogr2ogr, and discovered the -sql argument, which for some reason was not included in my local manpage.

Anyway the thing I ended up with was something like:
        ogr2ogr -sql "SELECT * FROM foo ORDER BY bar" shapefile shapefile

This seems to work as expected. I'm actually really happy with the painter model predictability of mapnik - I feel much more strongly in control of the visual output knowing how this works!

-mike.

On Jul 20, 2008, at 2:23 PM, David Leaver wrote:

The way I've done this is by ordering the shapefile when I export it from our postgis database: pgsql2shp -f road mydatabase "SELECT name, importance, the_geom FROM road ORDER BY importance DESC" (Note: there was a bug in an old pgsql2shp version where it would order by the first column you select rather than the order by statement. I've ran into this before)

Then the roads will be rendered from the lowest importance to the highest importance, which looks good for roads.

IIRC there is some tool that allows you to sort shapefiles on disk (but I can't seem to find it), maybe ogr2ogr could do it? Or worst case, import your shape to postgis, then export it specifying an order.

Cheers,
Dave.

Michal Migurski wrote:

Hello,

Using a shapefile datasource, is it possible to specify the order in
which records come out? OGR has some basic SQL features that allow
this, but what about Mapnik? I'm imagining a keyword argument to the
Python mapnik.Shapefile() constructor, but am having difficulty
following the C++ source.

-mike.

----------------------------------------------------------------
michal migurski- [EMAIL PROTECTED]
                  415.558.1610



_______________________________________________
Mapnik-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mapnik-users



--
David Leaver
SmarTrak Systems - "Always in Front"

phone: 07 857 0803
mobile: 021 876 684
email: [EMAIL PROTECTED]
fax: 07 857 0801


Innovation Park
Ruakura Rd
PO Box 7239
Hamilton East
Hamilton 3247
NEW ZEALAND

----------------------------------------------------------------
michal migurski- [EMAIL PROTECTED]
                 415.558.1610



_______________________________________________
Mapnik-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mapnik-users

Reply via email to