neo4j-contrib / spatial

Neo4j Spatial is a library of utilities for Neo4j that faciliates the enabling of spatial operations on data. In particular you can add spatial indexes to already located data, and perform spatial operations on the data like searching for data within specified regions or within a specified distance of a point of interest. In addition classes are provided to expose the data to geotools and thereby to geotools enabled applications like geoserver and uDig.
http://neo4j-contrib.github.io/spatial
Other
777 stars 191 forks source link

Linking Relations to corresponding Ways in Multipolygon Relations #390

Open brianruf opened 1 year ago

brianruf commented 1 year ago

It is not clear if there was ever a resolution to a similar issue outlined nearly 5 years ago as I am also having issues with Relation nodes/elements referring to Way nodes/elements when importing an OSM file although in my case it is not associated with negative ID's.

While MEMBER relations are created for some Relations (routes, restrictions, etc.) they do not seem to be created for multipolygon type relations (see example OSM data below) so I am wondering how to determine with accuracy for example if a point is in a multipolygon (i.e. city) using the corresponding graph model if we can not reconstruct the polygon?

Sample Multipolygon OSM object (parking lot): Screenshot 2022-09-07 034441

Screenshot 2022-09-07 032427

image

As with the original post on this issue, the log reveals a number of (total of 9) "Cannot find member" messages but these seem to be explainable by the comment from @craigtaverner regarding being caused "by slicing a piece of the bigger OSM graph." which was the case here.

Sample Log Entry for missing members (total of 9 entries): _.\import\KS_JO135th.osm[447104]: Cannot find member: {type=way, ref=34142211, role=outer}

Also like in the original post, the log also references a total number of missing members which is much larger than the members listed above.

Log entry for total missing members:
_.\import\KS_JO135th.osm[471176]: When processing the relations, there were 7294 missing members

Not sure if this log entry may indicate a problem or if the member relations are intentionally not included in this model.

In any event I would like to be able to accurately determine if points are within OSM multipolygons (not using approximations based on bounding box) and not sure how to do this with this data model.

I have tried this with a large OSM file consisting of a USA county and a much smaller one (i.e. 12K) as outlined here with the same results.

I am using DBMS Version 4.4.3 on NEO4j Desktop.

Originally posted by @brianruf in https://github.com/neo4j-contrib/spatial/issues/304#issuecomment-1239090453