natcap / urban-online-workflow

This repository hosts the beta implementation of the Urban Online ES Workflow. The project is intended to give urban planners the ability to create and assess scenarios using InVEST Urban models.
1 stars 5 forks source link

parcel coordinates are incorrect when parcel spans tiles #75

Closed davemfish closed 1 year ago

davemfish commented 1 year ago

When we click on a feature from a VectorTile layer (i.e. a parcel) and get it's flatCoordinates, these coordinates only represent the piece of that feature within the tile that was clicked.

See the image where the clicked parcel extends off the map and is highlighted in darker blue, while the coordinates that we extracted and sent to the server as WKT to represent this parcel are in the lighter blue.

)

So depending where in the parcel I click, the coordinates we use can vary.

The good news is, we already have the logic to find all the "pieces" of the parcel that span multiple tiles and add them to a single selection layer -- that's how we can correctly highlight the entire parcel (dark blue). So presumably we can extract the coordinates from that layer instead of from the individual feature that was clicked.

davemfish commented 1 year ago

fixed in #76