[OSM-dev] invalid geometry in planet_polygon

Jukka Rahkonen jukka.rahkonen at latuviitta.fi
Tue Aug 24 05:25:21 BST 2010


Hi,

Usually they are data errors.  Finland.osm seems to have 65 such errors. A
fast way to have a look at the faulty geometries is to run the SQL query
with OpenJUMP.  Use the Run Datastore Query option and run your query as

select asbinary(way), osm_id from planet_osm_polygon WHERE NOT
st_isvalid(way)

Then you can use OpenJUMP QA tools for finding out where the error exactly
is.

-Jukka Rahkonen-

> Hi,
>
> I tried some queries filtered with st_within and got a geos exception.
>
> I think it's caused by some geometries not being valid.
>
> Database is a standard mapnik import done by osm2pgsql.
>
> Postgis reports
> NOTICE:  Self-intersection at or near point 1.1195e+07 2.01783e+06
>
> This is relation 227259
>
> Is this a problem with the import of osm2pgsql or a problem with the data?
>
>
> I used this query to detect invalid geometries. There are more...
>
> select osm_id from planet_osm_polygon WHERE NOT st_isvalid(way)
>
> A dump of the invalid geometries of the planet is available on my server:
> http://downloads.osm-tools.org/invalid_geometry.csv
>
>
> Stephan
>
> _______________________________________________
> dev mailing list
> dev at openstreetmap.org
> http://lists.openstreetmap.org/listinfo/dev
>





More information about the dev mailing list