[OSM-Devserver] hstore: SELECT über way id

Sven Geggus lists at fuchsschwanzdomain.de
Fr Apr 9 00:05:40 CEST 2010


Tobias Wendorff <tobias.wendorff at uni-dortmund.de> wrote:

> Schlechte Neuigkeiten ... habe mal schnell gleiche IDs zwischen
> _polygon und _line abgefragt ... sind mehrere hundert, aber alles
> Relationen.

Ich durchschaue den Multipolygon Code nicht so recht und würde
da deshalb gerne meine Finger weg lassen.

Kannst Du bitte mal folgenden Patch testen?

Index: output-pgsql.c
===================================================================
--- output-pgsql.c	(Revision 20854)
+++ output-pgsql.c	(Arbeitskopie)
@@ -63,7 +63,7 @@
 #define FLAG_LINEAR  2    /* For lines table */
 #define FLAG_NOCACHE 4    /* Optimisation: don't bother remembering this one */
 #define FLAG_DELETE  8    /* These tags should be simply deleted on sight */
-#define FLAG_PHSTORE 16   /* polygons without own column but listed in hstore */
+#define FLAG_PHSTORE 17   /* polygons without own column but listed in hstore this implies FLAG_POLYGON */
 static struct flagsname {
     char *name;
     int flag;
@@ -694,7 +694,6 @@
         pushItem( tags, item );
 
     *polygon = flags & FLAG_POLYGON;
-    if ( flags & FLAG_PHSTORE) *polygon = 1;
 
     /* Special case allowing area= to override anything else */
     if ((area = getItem(tags, "area"))) {


Der Trick mit der 17 statt 16 als FLAG führt dazu, dass alles was mit
PHSTORE geflaggt ist automatisch in allen mir unbekannten Codeteilen
auch als Polygon angesehen wird, was zu klappen scheint.  Die eine
Codezeile in der explizit auf FLAG_PHSTORE geprüft wird dadurch
ebenfalls unnötig.

Gruss

Sven

-- 
"Those who do not understand Unix are condemned to reinvent it, poorly"
(Henry Spencer)

/me is giggls at ircnet, http://sven.gegg.us/ on the Web