Open IanLaingBCGov opened 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.
Added cqlfilter to getWFSjson, but got this:
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.
I wonder if the bbox coordinated need to be in bc albers coordinates?
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.
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.
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.
@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).
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