Skip to content

Commit 553e28a

Browse files
committed
Updated H3 to version 4.x.x
1 parent 47b7384 commit 553e28a

File tree

6 files changed

+11
-10
lines changed

6 files changed

+11
-10
lines changed

copyLatLonTool.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ def formatCoord(self, pt, delimiter):
170170
transform = QgsCoordinateTransform(canvasCRS, epsg4326, QgsProject.instance())
171171
pt4326 = transform.transform(pt.x(), pt.y())
172172
if H3_INSTALLED:
173-
msg = h3.geo_to_h3(pt4326.y(), pt4326.x(), settings.captureH3Precision)
173+
msg = h3.latlng_to_cell(pt4326.y(), pt4326.x(), settings.captureH3Precision)
174174
if msg == 0:
175175
msg = None
176176
else:

index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,13 @@ <h1>Lat Lon Tools Plugin</h1>
5151

5252
<ul>
5353
<li>
54-
<p><img src="images/copyicon.svg" alt="Copy/Display coordinate"> <strong><em>Copy/Display Coordinate</em></strong> - This captures coordinates onto the clipboard when the user clicks on the map, using the standard Google Map format or a format specified in <strong><em>Settings</em></strong>. If the user specifies a <strong>Tab</strong> separator, then the coordinate can be pasted into a spreadsheet in separate columns. While this tool is selected, the coordinate the mouse is over is shown in the lower left-hand corner either in <strong>decimal degrees</strong>, <strong>DMS</strong>, <strong>Degrees Minutes</strong>, <strong>MGRS</strong>, <strong>Standard UTM</strong>, <strong>UPS</strong>, <strong>GEOREF</strong>, <strong>Plus Codes (Open Location Code)</strong>, <strong>Geohash</strong>, <strong>H3</strong> (if the H3 library is installed), <strong>Maidenhead Grid Locator</strong>, <strong>WKT POINT</strong>, or <strong>GeoJSON</strong> notation depending on the <strong>Settings</strong>. By default it uses the geographic Latitude and Longitude to snapshot the coordinate, but this can be configured in <strong>Settings</strong> to use the project CRS or any other projection desired. See the <strong>Settings</strong> section for more details on the all the possibilities. An additional prefix or suffix can be added to the coordinate and is configured in <strong>Settings</strong>. If snapping is enabled under QGIS <strong><em>Project-&gt;Snapping Options...</em></strong> menu, then <em>Copy/Display Coordinate</em> will snap to any close vector vertices according to the parameters set in the snapping options.</p>
54+
<p><img src="images/copyicon.svg" alt="Copy/Display coordinate"> <strong><em>Copy/Display Coordinate</em></strong> - This captures coordinates onto the clipboard when the user clicks on the map, using the standard Google Map format or a format specified in <strong><em>Settings</em></strong>. If the user specifies a <strong>Tab</strong> separator, then the coordinate can be pasted into a spreadsheet in separate columns. While this tool is selected, the coordinate the mouse is over is shown in the lower left-hand corner either in <strong>decimal degrees</strong>, <strong>DMS</strong>, <strong>Degrees Minutes</strong>, <strong>MGRS</strong>, <strong>Standard UTM</strong>, <strong>UPS</strong>, <strong>GEOREF</strong>, <strong>Plus Codes (Open Location Code)</strong>, <strong>Geohash</strong>, <strong>H3</strong> (if the H3 version 4.x.x library is installed), <strong>Maidenhead Grid Locator</strong>, <strong>WKT POINT</strong>, or <strong>GeoJSON</strong> notation depending on the <strong>Settings</strong>. By default it uses the geographic Latitude and Longitude to snapshot the coordinate, but this can be configured in <strong>Settings</strong> to use the project CRS or any other projection desired. See the <strong>Settings</strong> section for more details on the all the possibilities. An additional prefix or suffix can be added to the coordinate and is configured in <strong>Settings</strong>. If snapping is enabled under QGIS <strong><em>Project-&gt;Snapping Options...</em></strong> menu, then <em>Copy/Display Coordinate</em> will snap to any close vector vertices according to the parameters set in the snapping options.</p>
5555
</li>
5656
<li>
5757
<p><img src="images/mapicon.png" width=24 height=24 alt="Show in External Map"> <strong><em>Show in External Map</em></strong> - With this tool, the user can click on the QGIS map which launches an external browser and displays the location on an external map. The left and right mouse buttons can be configured to show different maps. Currently Open Street Map, Google Maps, Google Earth Web, MapQuest, Mapillary, Open Street Map iD Editor, and Bing Maps are supported along with Google Earth if it is installed on the system. The desired map that is displayed can be configured in <strong><em>Settings</em></strong> along with additional user added map services. A temporary marker can be displayed on the map at the location clicked on. To turn this on go to <strong>Settings</strong>. If snapping is enabled, then the clicked location will snap to any close vector vertices according to the parameters set in the snapping options.</p>
5858
</li>
5959
<li>
60-
<p><img src="images/zoomicon.svg" alt="Zoom-to"> <strong><em>Zoom to Coordinate</em></strong> - With this tool, type or paste a coordinate into the text area and hit <strong>Enter</strong>. QGIS centers the map on the coordinate, highlights and creates a temporary marker at the location. For formats that represent a region rather than a point such as <strong>Geohash</strong>, <strong>H3</strong>, <strong>Maindenhead</strong>, and <strong>Plus Codes (Open Location Code)</strong>, the region area is displayed along with the center point. If the default <strong>WGS 84</strong> (EPSG:4326 - latitude/longitude) coordinate system is specified, <strong><em>Zoom to Coordinate</em></strong> can interpret <strong>decimal degrees</strong>, <strong>DMS</strong>, <strong>WKT POINT</strong>, <strong>Standard UTM</strong>, <strong>UPS</strong>, <strong>MGRS</strong>, <strong>GEOREF</strong>, <strong>Plus Codes (Open Location Code)</strong>, or <strong>GeoJSON</strong> coordinates. It can also zoom to <strong>Geohash</strong> coordinates, amateur radio <strong>Maidenhead</strong> grid coordinates, <strong>H3</strong> geohash coordinates (if the H3 library is installed), or any other projection when configured in <strong>Settings</strong> or by the <strong>Select CRS Mode</strong> button. The <strong><em>Coordinate Order</em></strong> in <strong><em>Settings</em></strong> or <strong>Toggle Coordinate Order</strong> button below dictates whether the order is latitude followed by longitude (Y,X) or longitude followed by latitude (X,Y). The following actions can also be taken from the <strong><em>Zoom To</em></strong> dialog:</p>
60+
<p><img src="images/zoomicon.svg" alt="Zoom-to"> <strong><em>Zoom to Coordinate</em></strong> - With this tool, type or paste a coordinate into the text area and hit <strong>Enter</strong>. QGIS centers the map on the coordinate, highlights and creates a temporary marker at the location. For formats that represent a region rather than a point such as <strong>Geohash</strong>, <strong>H3</strong>, <strong>Maindenhead</strong>, and <strong>Plus Codes (Open Location Code)</strong>, the region area is displayed along with the center point. If the default <strong>WGS 84</strong> (EPSG:4326 - latitude/longitude) coordinate system is specified, <strong><em>Zoom to Coordinate</em></strong> can interpret <strong>decimal degrees</strong>, <strong>DMS</strong>, <strong>WKT POINT</strong>, <strong>Standard UTM</strong>, <strong>UPS</strong>, <strong>MGRS</strong>, <strong>GEOREF</strong>, <strong>Plus Codes (Open Location Code)</strong>, or <strong>GeoJSON</strong> coordinates. It can also zoom to <strong>Geohash</strong> coordinates, amateur radio <strong>Maidenhead</strong> grid coordinates, <strong>H3</strong> geohash coordinates (if the H3 version 4.x.x library is installed), or any other projection when configured in <strong>Settings</strong> or by the <strong>Select CRS Mode</strong> button. The <strong><em>Coordinate Order</em></strong> in <strong><em>Settings</em></strong> or <strong>Toggle Coordinate Order</strong> button below dictates whether the order is latitude followed by longitude (Y,X) or longitude followed by latitude (X,Y). The following actions can also be taken from the <strong><em>Zoom To</em></strong> dialog:</p>
6161
<ul>
6262
<li><img src="doc/zoomtool.jpg" alt="Zoom button"> Pressing this button causes QGIS to zoom to the location. </li>
6363
<li><img src="doc/pastecoord.jpg" alt="paste coordinate"> This pastes the contents of the clipboard into the text area. </li>

metadata.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name=Lat Lon Tools
33
qgisMinimumVersion=3.4
44
description=Tools to capture and zoom to coordinates using decimal, DMS, WKT, GeoJSON, MGRS, UTM, UPS, Geohash, H3, Maidenhead grid, Plus Codes, and ECEF formats. Provides external map support, point digitizing tools, coordinate conversion tools, and conversion functions.
5-
version=3.7.3
5+
version=3.7.4
66
author=Calvin Hamilton
77
email=adenaculture@gmail.com
88
about=
@@ -30,6 +30,7 @@ hasProcessingProvider=yes
3030
experimental=False
3131
deprecated=False
3232
changelog=
33+
3.7.4 - Updated to work with H3 version 4.x.x
3334
3.7.3 - Fix to handle invalid geometries in Point layer to MGRS
3435
3.7.2 - Add clear marker button to Multi-zoom panel
3536
3.7.1 - Update metadata

readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ A number of the conversions can be accessed as field calculator functions. When
1616

1717
<div style="text-align:center"><img src="doc/calculator.jpg" alt="field calculator"></div>
1818

19-
* <img src="images/copyicon.svg" alt="Copy/Display coordinate"> ***Copy/Display Coordinate*** - This captures coordinates onto the clipboard when the user clicks on the map, using the standard Google Map format or a format specified in ***Settings***. If the user specifies a **Tab** separator, then the coordinate can be pasted into a spreadsheet in separate columns. While this tool is selected, the coordinate the mouse is over is shown in the lower left-hand corner either in **decimal degrees**, **DMS**, **Degrees Minutes**, **MGRS**, **Standard UTM**, **UPS**, **GEOREF**, **Plus Codes (Open Location Code)**, **Geohash**, **H3** (if the H3 library is installed), **Maidenhead Grid Locator**, **WKT POINT**, or **GeoJSON** notation depending on the **Settings**. By default it uses the geographic Latitude and Longitude to snapshot the coordinate, but this can be configured in **Settings** to use the project CRS or any other projection desired. See the **Settings** section for more details on the all the possibilities. An additional prefix or suffix can be added to the coordinate and is configured in **Settings**. If snapping is enabled under QGIS ***Project->Snapping Options...*** menu, then *Copy/Display Coordinate* will snap to any close vector vertices according to the parameters set in the snapping options.
19+
* <img src="images/copyicon.svg" alt="Copy/Display coordinate"> ***Copy/Display Coordinate*** - This captures coordinates onto the clipboard when the user clicks on the map, using the standard Google Map format or a format specified in ***Settings***. If the user specifies a **Tab** separator, then the coordinate can be pasted into a spreadsheet in separate columns. While this tool is selected, the coordinate the mouse is over is shown in the lower left-hand corner either in **decimal degrees**, **DMS**, **Degrees Minutes**, **MGRS**, **Standard UTM**, **UPS**, **GEOREF**, **Plus Codes (Open Location Code)**, **Geohash**, **H3** (if the H3 version 4.x.x library is installed), **Maidenhead Grid Locator**, **WKT POINT**, or **GeoJSON** notation depending on the **Settings**. By default it uses the geographic Latitude and Longitude to snapshot the coordinate, but this can be configured in **Settings** to use the project CRS or any other projection desired. See the **Settings** section for more details on the all the possibilities. An additional prefix or suffix can be added to the coordinate and is configured in **Settings**. If snapping is enabled under QGIS ***Project->Snapping Options...*** menu, then *Copy/Display Coordinate* will snap to any close vector vertices according to the parameters set in the snapping options.
2020

2121
* <img src="images/mapicon.png" width=24 height=24 alt="Show in External Map"> ***Show in External Map*** - With this tool, the user can click on the QGIS map which launches an external browser and displays the location on an external map. The left and right mouse buttons can be configured to show different maps. Currently Open Street Map, Google Maps, Google Earth Web, MapQuest, Mapillary, Open Street Map iD Editor, and Bing Maps are supported along with Google Earth if it is installed on the system. The desired map that is displayed can be configured in ***Settings*** along with additional user added map services. A temporary marker can be displayed on the map at the location clicked on. To turn this on go to **Settings**. If snapping is enabled, then the clicked location will snap to any close vector vertices according to the parameters set in the snapping options.
2222

23-
* <img src="images/zoomicon.svg" alt="Zoom-to"> ***Zoom to Coordinate*** - With this tool, type or paste a coordinate into the text area and hit **Enter**. QGIS centers the map on the coordinate, highlights and creates a temporary marker at the location. For formats that represent a region rather than a point such as **Geohash**, **H3**, **Maindenhead**, and **Plus Codes (Open Location Code)**, the region area is displayed along with the center point. If the default **WGS 84** (EPSG:4326 - latitude/longitude) coordinate system is specified, ***Zoom to Coordinate*** can interpret **decimal degrees**, **DMS**, **WKT POINT**, **Standard UTM**, **UPS**, **MGRS**, **GEOREF**, **Plus Codes (Open Location Code)**, or **GeoJSON** coordinates. It can also zoom to **Geohash** coordinates, amateur radio **Maidenhead** grid coordinates, **H3** geohash coordinates (if the H3 library is installed), or any other projection when configured in **Settings** or by the **Select CRS Mode** button. The ***Coordinate Order*** in ***Settings*** or **Toggle Coordinate Order** button below dictates whether the order is latitude followed by longitude (Y,X) or longitude followed by latitude (X,Y). The following actions can also be taken from the ***Zoom To*** dialog:
23+
* <img src="images/zoomicon.svg" alt="Zoom-to"> ***Zoom to Coordinate*** - With this tool, type or paste a coordinate into the text area and hit **Enter**. QGIS centers the map on the coordinate, highlights and creates a temporary marker at the location. For formats that represent a region rather than a point such as **Geohash**, **H3**, **Maindenhead**, and **Plus Codes (Open Location Code)**, the region area is displayed along with the center point. If the default **WGS 84** (EPSG:4326 - latitude/longitude) coordinate system is specified, ***Zoom to Coordinate*** can interpret **decimal degrees**, **DMS**, **WKT POINT**, **Standard UTM**, **UPS**, **MGRS**, **GEOREF**, **Plus Codes (Open Location Code)**, or **GeoJSON** coordinates. It can also zoom to **Geohash** coordinates, amateur radio **Maidenhead** grid coordinates, **H3** geohash coordinates (if the H3 version 4.x.x library is installed), or any other projection when configured in **Settings** or by the **Select CRS Mode** button. The ***Coordinate Order*** in ***Settings*** or **Toggle Coordinate Order** button below dictates whether the order is latitude followed by longitude (Y,X) or longitude followed by latitude (X,Y). The following actions can also be taken from the ***Zoom To*** dialog:
2424
* <img src="doc/zoomtool.jpg" alt="Zoom button"> Pressing this button causes QGIS to zoom to the location.
2525
* <img src="doc/pastecoord.jpg" alt="paste coordinate"> This pastes the contents of the clipboard into the text area.
2626
* <img src="doc/cleartool.jpg" alt="Clear marker"> The marker is removed with this button.

settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
try:
1414
import h3
1515
v = h3.versions()
16-
if v['python'][0] == '3':
16+
if int(v['python'][0]) >= 4:
1717
H3_INSTALLED = True
1818
else:
1919
H3_INSTALLED = False

zoomToLatLon.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,10 +189,10 @@ def convertCoordinate(self, text):
189189

190190
if self.settings.zoomToProjIsH3():
191191
# An H3 coordinate has been selected.
192-
if not h3.h3_is_valid(text):
192+
if not h3.is_valid_cell(text):
193193
raise ValueError(tr('Invalid H3 Coordinate'))
194-
(lat, lon) = h3.h3_to_geo(text)
195-
coords = h3.h3_to_geo_boundary(text)
194+
(lat, lon) = h3.cell_to_latlng(text)
195+
coords = h3.cell_to_boundary(text)
196196
pts = []
197197
for p in coords:
198198
pt = QgsPointXY(p[1], p[0])

0 commit comments

Comments
 (0)