hcarter333 / datasette-enrichments-gmap-elevation Goto Github PK
View Code? Open in Web Editor NEWRetrieves the elevations of coordinates along a path on Earth
License: Apache License 2.0
Retrieves the elevations of coordinates along a path on Earth
License: Apache License 2.0
Arrived at this issue
ImportError while importing test module 'C:\Users\m3n7es\source\datasette-enrichments-gmap-elevation\tests\test_elev_parse_args.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2544.0_x64__qbz5n2kfra8p0\Lib\importlib\__init__.py:126: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
tests\test_elev_parse_args.py:2: in <module>
from datasette_enrichments_gmap_elevation import get_template_args
datasette_enrichments_gmap_elevation\__init__.py:7: in <module>
from datasette_enrichments import Enrichment
venv\Lib\site-packages\datasette_enrichments\__init__.py:5: in <module>
from datasette_secrets import Secret, get_secret
venv\Lib\site-packages\datasette_secrets\__init__.py:5: in <module>
from datasette.plugins import pm
venv\Lib\site-packages\datasette\plugins.py:27: in <module>
pm.load_setuptools_entrypoints("datasette")
C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2544.0_x64__qbz5n2kfra8p0\Lib\importlib\metadata\__init__.py:202: in load
module = import_module(match.group('module'))
C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2544.0_x64__qbz5n2kfra8p0\Lib\importlib\__init__.py:126: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
E ModuleNotFoundError: No module named 'datasette_gis_partial_path_lat'
I'm not controlling the version of datasette I require:
dependencies = [
"datasette",
"datasette-enrichments>=0.2",
"sqlite-utils",
"datasette-gis-partial-path",
]
As can be seen above, I am controlling the version of enrichments for some reason. I'll try removing that control. Current release is 0.4.2
Using the URL instructions at (or trying to) I get
{"results":[],"status":"INVALID_REQUEST"}
Using the documentation example:
https://maps.googleapis.com/maps/api/elevation/json?path=36.578581%2C-118.291994%7C36.23998%2C-116.83171&samples=3&key=YOUR_API_KEY
gives
{
"results" :
[
{
"elevation" : 4411.94189453125,
"location" :
{
"lat" : 36.578581,
"lng" : -118.291994
},
"resolution" : 19.08790397644043
},
{
"elevation" : 1372.8359375,
"location" :
{
"lat" : 36.41150289067028,
"lng" : -117.5602607523847
},
"resolution" : 9.543951988220215
},
{
"elevation" : -84.51690673828125,
"location" :
{
"lat" : 36.23998,
"lng" : -116.83171
},
"resolution" : 9.543951988220215
}
],
"status" : "OK"
}
What happens if I ask for 200 points along the path?
I get a lot of point!
So, that's good. Putting in the coordinate for my 200 meter path gives
(Putting them in one at a time...)
First point is good with second example point.
Second point also worked, so it will be time to crack out jq in a minute, but still... What was the issue?
Comparing the addresses:
My original
https://maps.googleapis.com/maps/api/elevation/json?path=37.72489522009444%2C-122.42293617440532%7C37.72472947037526%2C-122.42072468451954&samples=200
https://maps.googleapis.com/maps/api/elevation/json?path=37.72489522009444%2C-122.42293617440532%7C37.72472947037526%2C-122.42072468451954&samples=200
The one that worked is above
Done! (Look towards the bottom of the sheet for the chart.
Here's the jq filter for the results:
.results[].elevation
Google Earth:
Request URL minus key:
https://maps.googleapis.com/maps/api/elevation/json?path=37.72489522009444%2C-122.42293617440532%7C37.72472947037526%2C-122.42072468451954&samples=200&key=
Automate this a bit more by providing csv with indexes corresponding to meters.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.