bcgov / bc-aquifer-dashboard

A dashboard/portal for viewing and querying provincial aquifer data
Apache License 2.0
4 stars 1 forks source link

Regional Rollup #9

Open IanLaingBCGov opened 6 years ago

IanLaingBCGov commented 6 years ago
wburt commented 6 years ago

Need to enable a parameter in the wfs execution for cql http://docs.geoserver.org/stable/en/user/tutorials/cql/cql_tutorial.html Initially aquifers and wells should support this to allow both attribute queries and spatial queries. Might be able add optional parameters to getWFSJson and use L.Util.extend to append them when populated.

IanLaingBCGov commented 6 years ago

Added cqlfilter to getWFSjson, but got this: bbox and cqlfilter both specified but are mutually exclusive

geoserver (and internet) help says I can add bbox inside the cql_filter, however, it doesn't allow epsg to be specified. Need to dig further.

wburt commented 6 years ago

I wonder if the bbox coordinated need to be in bc albers coordinates?

IanLaingBCGov commented 6 years ago

Yup, you're right Will, the bbox (nested within the cql_filter) needed to be in the wfs native crs: bc albers. I still wonder if it's an either/or thing. i.e., the cql_filter should be either an attribute query OR a bbox spatial query, but not both at the same time.

wburt commented 6 years ago

I think that might work or we can find some code to translate bbox geographic to bcAlbers and append to a default select all cql query.

wburt commented 6 years ago

Proj4js - https://github.com/proj4js

Wild Goose Chase over: bbox DOES accept WGS coordinates; needed to enclose 'epsg:4326' optional parameter in single quotes. Don't need to re-project to BC Albers with each WFS call.

IanLaingBCGov commented 6 years ago

@paulfi , I tried your clipAquifersToRegion function, which in turn calls clipFeaturecollection, but got a TopologyException back from Turf (pointing to x=-122.67069, y=53.92834). There is a sliver in the Aquifer data (stemming from the BCGW) at that location (Aquifer_Number = '0092') and others.

I tried a turf.union (aq0092, OminecaRegion) and it threw the same TopologyException.

I'll dive back into it on Monday (Mar 26).

paulfi commented 6 years ago

I removed the slivers from the aquifer_simple.json the 'clip' process completes, but its too slow to be useful. maybe if it started with only the aquifers in the BBOX of the regions, then clipped those. need a wrench not a hammer