[Tile-serving] [openstreetmap/osm2pgsql] Does the -G option support MultiPoint and MultiLineString geometries? (#609)

Willie Maddox notifications at github.com
Thu Jul 21 06:05:40 UTC 2016


Ok, then something must be wonky with the way I am creating my tables.  Running osm2pgsql without the -G option I wasn't able to create a separate table from planet_osm_polygon for just the buildings with the osm_id as the primary key because of all the duplicate osm_ids.  Adding the -G option fixed that.  I was hoping the same would be true for the planet_osm_line.  Here is my SQL for the buildings:

```sql
DROP TABLE IF EXISTS buildings;
CREATE TABLE buildings AS SELECT
	osm_id,
	name,
	way,
	building,
	--Record the height iff the height is already in numeric form.
	CASE
	WHEN tags->'height' = '.' THEN
	    NULL
	WHEN tags->'height' ~ E'^([0-9.]+)$' THEN
	    CAST (tags->'height' AS NUMERIC)
	ELSE
	    NULL
	END AS height
	FROM planet_osm_polygon WHERE building IS NOT NULL;

--Feature id (gml:id) is based on primary key column
--http://download.deegree.org/documentation/3.3.16/html/featurestores.html
ALTER TABLE buildings ADD PRIMARY KEY (osm_id);
CREATE INDEX ON buildings USING GIST (way);
```

Should I be doing this a different way?

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/osm2pgsql/issues/609#issuecomment-234164913
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20160720/baad768c/attachment.html>


More information about the Tile-serving mailing list