Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to merge geoms for AOI splitting during project creation #3

Open
spwoodcock opened this issue Feb 26, 2024 · 14 comments
Open

Option to merge geoms for AOI splitting during project creation #3

spwoodcock opened this issue Feb 26, 2024 · 14 comments
Labels
enhancement New feature or request

Comments

@spwoodcock
Copy link
Member

spwoodcock commented Feb 26, 2024

Is your feature request related to a problem? Please describe.

  • Sometimes the AOI geojson is a feature collection or multipolygon.
  • Splitting will fail if a multi geom is used.

Describe the solution you'd like

  • Provide the option to convex hull the geoms.
  • Probably via a checkbox the user ticks (as they may wish to use the multigeom as the actual task boundaries instead).

Describe alternatives you've considered

  • Even better would be an actual merging of geom outlines, but this is complex if the boundaries do not perfectly align.
  • The convex hull should possibly be in fmtm-splitter, the same as the one in osm-rawdata.

Additional context

Requirement from an actual mapping campaign in Liberia.

@spwoodcock spwoodcock added the enhancement New feature or request label Feb 26, 2024
@spwoodcock
Copy link
Member Author

Related to hotosm/fmtm#1263

We should probably have a configuration section in place on the frontend if the user selects the splitting algorithm.

@Sujanadh
Copy link

I think I did this long ago using an approach to splitting each individual polygon from a multipolygon by passing a polygon at a time to the algorithm, which splits it and appending the results of every polygon.

@spwoodcock
Copy link
Member Author

Yes I think the code is there to loop through geoms and return a list of FeatureCollections 👍

The issue is that often by processing separately the geom does not have enough polyline data within it to split correctly.

The best solution is improving the splitting algorithm so it doesn't need polylines. If none are present then the features are simply divided up using the 'num buildings' param.

We should probably also provide a configuration to merge the geoms before splitting, if the user wishes.

@Sujanadh
Copy link

For now, if user uploads two polygons where they are touched or overlapping as an AOI, and still chooses to split task we combine those polygons making a single polygon and allow splitting
Again, if those polygons are disjoint we dissolve those polygons and create new boundary as an aoi and allow splitting if they choose task split.
Input Polygons
image

Output
image

task-split
image

@Sujanadh
Copy link

@spwoodcock

@spwoodcock
Copy link
Member Author

Does this already exist? Nice if so, we can close the issue!

@spwoodcock spwoodcock changed the title Option to merge geoms for AOI during project creation Option to merge geoms for AOI splitting during project creation Jun 25, 2024
@spwoodcock
Copy link
Member Author

spwoodcock commented Jun 25, 2024

Yeah I think this is all good 👍

I uploaded a multipolygon AOI and successfully generated an extract.

image

I then ran the splitter:

image

@Sujanadh
Copy link

Sujanadh commented Jun 27, 2024

yes, it does allow splitting but there is still an issue while creating the project with this type of AOI, since we don't accept multipolygon as a project AOI.

@Sujanadh Sujanadh reopened this Jun 27, 2024
@Sujanadh
Copy link

There is slight issue while merging polygons; we perform unary_union if the polygon is mulitpolygon , but if the polygons are disjoint then it will again results into MultiPolygon type, so in order to handle that we need to dissolve those polygons and create new boundary with a single polygon.

@Sujanadh
Copy link

image
This what it looks like while splitting task using disjoint polygon.
if we want to dissolve the polygons and split it , it will look like this:
image
so if we want to handle splitting like the first one , we should allow db to save multipolygon aoi also.
if not we need to apply convex hull to dissolve the polygons and create a single Polygon like the second one.

@Sujanadh
Copy link

Or we can split like the 1st case , but make project aoi like the 2nd case by using separate merging process.

@manjitapandey
Copy link

I think first type of merging covers most of the use cases. We can work on second type of cases if requested for any field mapping activity. But for now, i can't imagine scenarios where they upload disjoint polygons and want tasks to get merged.

@spwoodcock
Copy link
Member Author

spwoodcock commented Jan 8, 2025

Its not common, granted, but it could be a nice future feature that the user uploads their custom data extract and the AOI is automatically generated by enveloping (convex hull / merging) the geoms

@spwoodcock
Copy link
Member Author

Can be addressed in hotosm/geojson-aoi-parser

@manjitapandey manjitapandey transferred this issue from hotosm/fmtm Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants