You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(add-data): geocode delimited-text addresses at import time (#1604)
* feat(add-data): geocode delimited-text addresses at import time
Adds an "Addresses (geocode)" import mode to the Delimited Text Layer
panel alongside the existing coordinate-column mode: pick one or more
columns to concatenate into an address and each row is geocoded
through the project's configured provider. Matched rows become points
stamped with geocode_provider/geocode_status; unmatched rows are kept
as null-geometry features (geocode_status: "unmatched") instead of
being silently dropped, so they stay visible and fixable in the
attribute table.
* style: auto-format (ruff + oxfmt) [pre-commit.ci]
* fix(add-data): address CSV-geocode review findings
- Distinguish a batch cancelled before any row completed from a
completed run with zero matches, so the thrown error doesn't
misreport "No rows could be geocoded" for a cancellation.
- Persist geocodeSkippedEmpty/geocodeCancelled on the layer alongside
the existing geocodeMatched/geocodeUnmatched metadata, so a
cancelled or partially-skipped run isn't silently indistinguishable
from a complete one after the fact.
- Give the address-columns empty-state hint its own i18n string
instead of reusing the "Retrieve columns" button label as body copy.
- Apply the unmatched-rows attribute filter after addAndClose selects
the new layer, not before.
* fix(add-data): fail fast on a missing API key, style geocoded points
- Check geocoderNeedsApiKey before starting the batch, mirroring
GeocodeDialog's guard, instead of paying a full paced loop of
requests that are all doomed to fail with a keyed provider that has
no key configured.
- Pass the matched-feature collection as createBaseLayer's vector
option so a geocoded address layer gets the as-added palette color
and point sizing (#1519) like every other point-producing import
path, instead of always rendering flat DEFAULT_LAYER_STYLE. An
all-unmatched run (nothing to draw) keeps the flat defaults, mirroring
the coordinate-mode attribute-table branch.
* fix(add-data): preserve row order and stop stale address columns
- Build the geocoded FeatureCollection in original CSV row order
instead of grouping every matched point before every unmatched row,
so the attribute table lines up with the source file. matchedFeatures
now feeds the as-added style inference on its own, not the mixed
collection.
- Give the address-columns checklist its own field list derived only
from the retrieved header, instead of reusing the coordinate-mode
Select's field options, which always carries non-blank "longitude"/
"latitude" defaults and both hid the "retrieve columns first" empty
state and could offer columns the file doesn't have.
- Clear delimitedTextAddressColumns whenever the header resets (new
file, delimiter change, mode switch) so a selection can't outlive
the header it was picked against, and drop any stale selection that
still slips through right before building geocode requests.
* style: auto-format (ruff + oxfmt) [pre-commit.ci]
* fix(add-data): clear the stale unmatched attribute filter
setAttributeFilter was only ever set to "unmatched", never cleared, so
a prior geocode run that left the global filter on "unmatched" stayed
active and hid every row of a later, fully-matched layer. Always set
it (to "unmatched" or "") after addAndClose selects the new layer.
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Copy file name to clipboardExpand all lines: apps/geolibre-desktop/src/i18n/locales/en.json
+11-2Lines changed: 11 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -283,7 +283,7 @@
283
283
},
284
284
"delimitedText": {
285
285
"label": "Add Delimited Text Layer",
286
-
"description": "Add a delimited text file or URL as a point layer using longitude and latitude fields, or as a non-spatial attribute table when no coordinates are available."
286
+
"description": "Add a delimited text file or URL as a point layer using longitude and latitude fields, by geocoding an address column, or as a non-spatial attribute table when no coordinates are available."
287
287
},
288
288
"cad": {
289
289
"label": "Add CAD (DXF/DWG) Layer",
@@ -579,7 +579,15 @@
579
579
"crs": "Coordinate system",
580
580
"crsPlaceholder": "e.g. EPSG:32643",
581
581
"crsPresetLabel": "Common coordinate systems...",
582
-
"crsHelp": "Leave blank if the coordinates are already longitude/latitude (WGS84). Otherwise enter the EPSG code of the coordinate columns and the points will be reprojected to WGS84. For a projected CRS, the longitude and latitude fields select the X (easting) and Y (northing) columns."
582
+
"crsHelp": "Leave blank if the coordinates are already longitude/latitude (WGS84). Otherwise enter the EPSG code of the coordinate columns and the points will be reprojected to WGS84. For a projected CRS, the longitude and latitude fields select the X (easting) and Y (northing) columns.",
583
+
"importMode": "Import as",
584
+
"modeCoordinates": "Coordinates",
585
+
"modeAddresses": "Addresses (geocode)",
586
+
"addressColumns": "Address columns",
587
+
"addressColumnsEmptyHint": "Retrieve columns first to select address columns.",
588
+
"addressColumnsHint": "Select one or more columns to concatenate into the address sent to the geocoder (e.g. street, city, state).",
589
+
"errorNoAddressColumns": "Select at least one address column.",
590
+
"errorNoAddressesFound": "No rows had a value in the selected address column(s)."
583
591
},
584
592
"photos": {
585
593
"defaultName": "Photos",
@@ -2743,6 +2751,7 @@
2743
2751
"summary": "Geocoded {{matched}} of {{total}} row(s); {{failed}} had no match.",
2744
2752
"failedRows": "Rows with no match: {{rows}}",
2745
2753
"noMatches": "No rows could be geocoded.",
2754
+
"cancelledNoRows": "Cancelled before any rows were geocoded.",
Copy file name to clipboardExpand all lines: docs/user-guide/adding-data.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ The **Add Data** menu is the main way to bring layers into GeoLibre. It groups s
10
10
| --- | --- |
11
11
|**Vector Layer**| Opens the Add Vector panel (backed by `maplibre-gl-vector`). Loads GeoJSON, GeoParquet, FlatGeobuf, zipped Shapefile, GeoPackage, KML/KMZ, GML, and other vector formats from a file or URL. |
12
12
|**Raster Layer**| Opens the Add Raster panel (backed by `maplibre-gl-raster`). Loads GeoTIFF and Cloud-Optimized GeoTIFF (COG) from a file or URL. |
13
-
|**Delimited Text Layer**| Loads CSV/TSV from a file or URL, using longitude and latitude columns to build point features. |
13
+
|**Delimited Text Layer**| Loads CSV/TSV from a file or URL, using longitude and latitude columns to build point features, or by geocoding one or more address columns (see [Geocoding](data-integrations.md#geocoding)). |
14
14
|**GPX Layer**| Loads a GPX file or URL and splits it into separate waypoint, track, and route layers. |
15
15
|**MBTiles Layer**| Loads a local MBTiles tile archive (desktop app). |
Copy file name to clipboardExpand all lines: docs/user-guide/data-integrations.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -56,9 +56,10 @@ GeoLibre can turn addresses into points and points into addresses. Both run thro
56
56
| Tool | Where | What it does |
57
57
| --- | --- | --- |
58
58
|**Geocode Addresses**| Processing menu | Pick a CSV with an address column and geocode each row into a point layer. Each matched row keeps its original columns plus `geocode_lat`, `geocode_lon`, `geocode_display_name`, and `geocode_importance` (a match score). A per-run provider picker lets you switch backend for that batch. |
59
+
|**Delimited Text Layer → Addresses**| Add Data | Geocode a CSV/TSV at import time instead of a separate step: choose "Addresses" as the import mode, pick one or more columns to concatenate into the address (e.g. street, city, state), and each row is geocoded through the project's configured provider. Matched rows become points; rows with no match are kept (not dropped) with `geocode_status: "unmatched"` so they stay visible and fixable in the attribute table. |
59
60
|**Reverse Geocode**| Controls menu | A toggle. While on, click anywhere on the map to look up the address at that point, shown in a popup with a copy button. |
60
61
61
-
Both send coordinates or addresses to a third-party service, so the first time you enable Reverse Geocode (and whenever you run a batch) your data leaves your device for those requests. Reverse Geocode shows a one-time notice before it is first enabled.
62
+
All three send coordinates or addresses to a third-party service, so the first time you enable Reverse Geocode (and whenever you run a batch, including at CSV import time) your data leaves your device for those requests. Reverse Geocode shows a one-time notice before it is first enabled.
0 commit comments