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 #1282

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

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

spwoodcock opened this issue Feb 26, 2024 · 11 comments
Labels
backend Related to backend code enhancement New feature or request frontend Related to frontend code priority:low Backlog of tasks that will be addressed in time

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 backend Related to backend code enhancement New feature or request frontend Related to frontend code labels Feb 26, 2024
@spwoodcock
Copy link
Member Author

Related to #1263

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

@Sujanadh
Copy link
Contributor

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.

@spwoodcock spwoodcock added this to the FMTM 2024.04 Release milestone Mar 1, 2024
@spwoodcock spwoodcock added the priority:low Backlog of tasks that will be addressed in time label Mar 21, 2024
@Sujanadh
Copy link
Contributor

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
Contributor

@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
Contributor

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
Contributor

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
Contributor

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
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Related to backend code enhancement New feature or request frontend Related to frontend code priority:low Backlog of tasks that will be addressed in time
Projects
None yet
Development

No branches or pull requests

2 participants