[OSM-dev] Using NULL values in mapnik / postgres DB

Jon Burgess jburgess777 at googlemail.com
Tue Feb 20 21:40:31 GMT 2007


I received an email from Martin Spott which suggested that we change the
Postgres database fields used by osm2pgsql + mapnik to utilise NULL in
place of empty text strings. 

Martin believes this will make the database lookups more efficient and
i'm inclined to believe him.

To make this change we need to change both osm2pgsql.c and the osm.xml
mapnik rules to generate and parse the NULL SQL values.

I've done a quick trial on my local machine and it is fairly trivial to
implement this. For reference the osm.xml changes look like:

  char_length(foo)=0   changes to   foo IS NULL
  char_length(foo)>0   changes to   foo IS NOT NULL

Any thoughts about whether I should go ahead and make this change?

Jon






More information about the dev mailing list