Open laurenwalker opened 6 years ago
It seems like it would be good to introspect spatial data and pull out the bounding box. This might be able to be done with node-gdal.
Good point @jkibele, perhaps that would include Shapefiles and GeoJSON/TopoJSON?
I would suggest to not offer the option of entering lat/long in degree, minute, sec...
+1 on parsing the info from files! I would suggest to add geotiff rasters to the list
I've currently got one of our data fellows writing some Python functions of introspecting spatial data to pull out bounding coordinates. ...of course a Python script won't be of much use on the client side, but maybe there's a way to work it in? It's largely a learning exercise for her anyway.
It basically just takes any file, tries to open it with gdal (that would cover most raster formats), then tries to open it with OGR if that fails (that would cover most vector formats including shapefile), then tries to open it as a csv and guess the lat/lon fields if the other two tries failed. Success will return bounding coordinates (in WGS84).
At some point, I'll poke around and see if there's any reasonable way to do this on the client side. ...I kind of suspect not though.
Hmm... This js library might work for rasters. ...though I'm not familiar with Emscripten, so I don't know if it'll fit in properly with metacatui, but I think it's client side. I'll try to look in to it later.
Note: I've seen two user requests for this feature in the last week, once when I demoed the site to the UCSB library, and once from an Arctic Data Center user in https://support.nceas.ucsb.edu/rt/Ticket/Display.html?id=24666 In particular, they want to draw the bounding box on a map rather than enter coordinates.
Tina mentioned that this is an important feature for SCTLD as well.
The user should be able to add geographic locations in the following ways: