Open G-Boyce opened 2 months ago
Test
@G-Boyce Mention
I have no requirement for the data to be a GeoJSON string. Any format of data can be passed, as long as I know what format I need to construct, that's OK.
To summarise our feature request. @G-Boyce, please edit if something is missing.
@G-Boyce The code is now ready to test: https://canadian-geospatial-platform.github.io/geoview/public/demo-geojson-inject.html
Seems to be working so far. Thanks!
Is there an existing issue for this?
Who request this Feature
Greg Boyce, Data Management Plan tool, NRCan
User Story
I'd like to be able to pass GeoJSON data (e.g. as a text string) into the cgpv.init function.
Implementation UI
Rather than being forced to read GeoJSON data from a fixed file on the web server, I'd like to dynamically build up the data using an SQL query in PHP, and pass that GeoJSON string into the cgpv.init function. (Instead of parsing the file, parse the passed string.)
Otherwise, I'll likely need to create files on the web server, which gets messy (disk space checks, regular file cleanup, etc).
Note: we already have a web page which creates HTML/JavaScript output from SQL queries, so setting up a new WFS server to also query this data, would presumably double the database query load.
Data passed into cgpv.init, should probably be in addition to layers already defined in the map Config section. (E.g. you have several layers well defined by WFS or other layer types in the map config section, and just want to add data for one dynamically constructed layer.)
So, using the following Config string (from GeoJSON layer page):
Basically allowing the contents of "polygons.json" to be passed into cgpv.init as a parameter.
The metadataAccessPath (metadata.json) could remain in the config (or be passed in, too).