Closed Tootman closed 4 years ago
I've spent considerable time looking into this issue now. I've been trying to extend the Area mapping tool to provide a means to display a list of features contained within the Area polygon.
The basic problem is that Mapbox (The platform I am using for the client map) is not well suited to general GIS spatial queries against features - it's intended for visualizing/rendering features. The issue is that lines and polygons are split when they happen to cross Map tiles. They then appear in the list of features, as duplicate features, and it does not appear easy to remove these 'duplicate' objects, from the resulting list. So would still be fit-for-purpose if it included these duplicates.
Also what to do about lines and polygons that intersect the Area polygon. Should, they be included, or excluded, or have mixture, depending on rules/conditions.
To summarize, The client map is not suited to this task - so I will task on hold. (It would be feasible for other methods and platforms eg GeoSpatial queries on a map with a postGIS source).
(Technical details & demo of progress so far: see D:\xampp\htdocs\xampp\maps\sandbox\drawpoly.html experiement, based on using points-within-polygon and queryRenderedFeatures)
Also see git branch extendpolygontool
he Area polygon tool display window would contain a button labled something like 'show enclosed features'. Which will ideally, assemble a list of All the VISIBLE features contained within the polygon, and then display them in tabular form, or create a csv file, which the client can save on their PC.
Not sure how feasible the task is - may just fall back to disaplying all features displayed within the viewport, or within a bounding box - need to investigate.
Need to decide about whether to include line and polygon features that are partially inside bounding polygon.