[postgis-users] Raster + Geometry Intersection

Pierre Racine Pierre.Racine at sbf.ulaval.ca
Tue Feb 28 07:20:53 PST 2012


> SELECT o.osm_id,
>          ST_Intersection(ST_Transform(o.way,4326), s.rast)
>   FROM planet_osm_line o,
>        srtm_tiled_4326 s
>   WHERE ST_Intersects(ST_Transform(o.way,4326), s.rast)
>   and   o.highway = 'primary';
> 
> I keep seeing the following messages below!
> 
> NOTICE:  Ring Self-intersection at or near point 8.50333 55.5392
> CONTEXT:  PL/pgSQL function "st_intersection" line 10 at RETURN QUERY
> NOTICE:  Ring Self-intersection at or near point 8.87833 55.5408
> CONTEXT:  PL/pgSQL function "st_intersection" line 10 at RETURN QUERY
> NOTICE:  Ring Self-intersection at or near point 8.63 55.5192
> CONTEXT:  PL/pgSQL function "st_intersection" line 10 at RETURN QUERY
> NOTICE:  Ring Self-intersection at or near point 8.685 55.5083

But these are just notices. Do you get some results from the intersection?

Apparently there are some invalid lines in planet_osm_line. You could identify and fix them with ST_IsValid(), ST_IsValidReason() and ST_MakeValid(). Check http://postgis.refractions.net/documentation/manual-svn/using_postgis_dbmanagement.html#OGC_Validity

Pierre




More information about the postgis-users mailing list