[OSM-dev] Using NULL values in mapnik / postgres DB
Artem Pavlenko
artem at pavlenko.uklinux.net
Tue Feb 20 22:12:15 GMT 2007
Jon,
Sounds good to me! Also, it might be a good idea to split osm data into
multiple tables in postgresql and only keep fields that are required :
1. roads (LINESTRING) : osm_id,highway,level,name ...
2. all points (POINT) : osm_id, amenity,...
3. all polygons (POLYGONS): osm_id, natural, leisure etc.
Thoughts?
Also, I'm not entirely convinced that using TEXT is more efficient than
VARCHAR(<length>) ??? Was it mentioned somewhere in docs?
And last one:) . How about correcting geometries at the translation stage? I
think we can use GEOS (c++ lib) to 'node' and 'linemerge' _bad_ ways into
clean ones.
Artem
On Tuesday 20 February 2007 21:40, Jon Burgess wrote:
> 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
>
>
>
> _______________________________________________
> dev mailing list
> dev at openstreetmap.org
> http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/dev
More information about the dev
mailing list