JuliaGeo¶
JuliaGeo is a (Github) organization that contains a number of related Julia projects for manipulating, querying, and processing geospatial geometry data. We aim to provide a common interface between geospatial packages. We also have a website.
We previously presented about JuliaGeo related work in:
- FOSS4G2019 | JuliaGeo: A Fresh Approach to GeospatialComputing
- JuliaCon2020 | GeoInterface: bringing geospatial packages together
- JuliaCon2022 | State of JuliaGeo
The geospatial stack is not as mature as others (yet), mostly due to its age as Python and R have had a 20 years headstart. However, it is already easy to install the required C dependencies and read all common data formats into Julia types that can be used across the ecosystem.
]add ArchGDAL, RasterDataSources
Updating registry at `C:\Users\Leonie Lokal\.julia\registries\General.toml` Resolving package versions... Installed ASCIIrasters ────── v0.1.1 Installed RasterDataSources ─ v0.5.7 Installed ZipFile ─────────── v0.9.4 Updating `C:\Users\Leonie Lokal\.julia\environments\v1.9\Project.toml` [c9ce4bd3] + ArchGDAL v0.10.1 [3cb90ccd] + RasterDataSources v0.5.7 Updating `C:\Users\Leonie Lokal\.julia\environments\v1.9\Manifest.toml` [81770e7c] + ASCIIrasters v0.1.1 [3cb90ccd] + RasterDataSources v0.5.7 ⌅ [a5390f91] + ZipFile v0.9.4 Info Packages marked with ⌅ have new versions available but compatibility constraints restrict them from upgrading. To see why use `status --outdated -m` Precompiling project... ✓ ASCIIrasters ✓ ZipFile ✓ RasterDataSources ✓ Rasters → RastersRasterDataSourcesExt 4 dependencies successfully precompiled in 18 seconds. 288 already precompiled. 1 dependency had warnings during precompilation: ┌ RasterDataSources [3cb90ccd-e1b6-4867-9617-4276c8b2ca36] │ ┌ Warning: Replacing docs for `RasterDataSources.getraster :: Union{}` in module `RasterDataSources` │ └ @ Base.Docs docs\Docs.jl:243 └
import Pkg
Pkg.add("DataFrames")
Resolving package versions... Updating `C:\Users\Leonie Lokal\.julia\environments\v1.9\Project.toml` [a93c6f00] + DataFrames v1.6.1 No Changes to `C:\Users\Leonie Lokal\.julia\environments\v1.9\Manifest.toml`
]add ArchGDAL
using GeoDataFrames, DataFrames, Rasters, GeoArrays, GeoInterface, Downloads, Plots, ArchGDAL, RasterDataSources
Raster data¶
Let's download and open a small geotiff file. We use Rasters
, a package inspired by rasterio in Python.
url = "https://github.com/yeesian/ArchGDALDatasets/blob/master/data/utmsmall.tif?raw=true"
fn = "utmsmall.tif"
fn = isfile(fn) ? fn : Downloads.download(url, "utmsmall.tif")
isfile(fn)
true
using Rasters
raster = Raster(fn)
100×100 Raster{UInt8,2} with dimensions: X Projected{Float64} LinRange{Float64}(440720.0, 446660.0, 100) ForwardOrdered Regular Intervals crs: WellKnownText, Y Projected{Float64} LinRange{Float64}(3.75126e6, 3.74532e6, 100) ReverseOrdered Regular Intervals crs: WellKnownText and reference dimensions: Band Categorical{Int64} 1:1 ForwardOrdered extent: Extent(X = (440720.0, 446720.0), Y = (3.74532e6, 3.75132e6))crs: PROJCS["NAD27 / UTM zone 11N",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213898,AUTHORITY["EPSG","7008"]],AUTHORITY["EPSG","6267"]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4267"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-117],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Easting",EAST],AXIS["Northing",NORTH],AUTHORITY["EPSG","26711"]] parent: 3.75126e6 3.7512e6 … 3.74538e6 3.74532e6 440720.0 0x6b 0x73 0x42 0x84 440780.0 0x7b 0x84 0x8c 0xad 440840.0 0x84 0x6b 0x8c 0x9c 440900.0 0x73 0x7b 0x9c 0x94 440960.0 0x84 0x94 … 0x73 0x19 441020.0 0x84 0x73 0x3a 0x10 ⋮ ⋱ ⋮ 446360.0 0xd6 0xce 0x84 0x94 446420.0 0xf7 0xff … 0x63 0x63 446480.0 0xff 0xbd 0x52 0x52 446540.0 0xe6 0xd6 0x5a 0x5a 446600.0 0xce 0xce 0x5a 0x7b 446660.0 0xc5 0xd6 0x6b 0xa5
p = plot(raster; c=:deep)
We can request the coordinates of a (center of a) cell with coords
, and also do the inverse with indices
@time view(raster, X(446000..446660), Y(3.75e6..3.75126e6))
0.139923 seconds (314.91 k allocations: 19.950 MiB, 99.95% compilation time)
11×21 Raster{UInt8,2} with dimensions: X Projected{Float64} LinRange{Float64}(446000.0, 446600.0, 11) ForwardOrdered Regular Intervals crs: WellKnownText, Y Projected{Float64} LinRange{Float64}(3.7512e6, 3.75e6, 21) ReverseOrdered Regular Intervals crs: WellKnownText and reference dimensions: Band Categorical{Int64} 1:1 ForwardOrdered extent: Extent(X = (446000.0, 446660.0), Y = (3.75e6, 3.75126e6))crs: PROJCS["NAD27 / UTM zone 11N",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213898,AUTHORITY["EPSG","7008"]],AUTHORITY["EPSG","6267"]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4267"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-117],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Easting",EAST],AXIS["Northing",NORTH],AUTHORITY["EPSG","26711"]] parent: 3.7512e6 3.75114e6 … 3.75006e6 3.75e6 446000.0 0xff 0xef 0xc5 0xc5 446060.0 0xad 0xff 0xb5 0x9c 446120.0 0xff 0xe6 0x9c 0xad 446180.0 0xad 0xd6 0x8c 0x9c 446240.0 0xde 0xff … 0xb5 0xbd 446300.0 0xff 0xff 0x84 0x7b 446360.0 0xce 0xef 0xad 0x8c 446420.0 0xff 0xb5 0xbd 0xff 446480.0 0xbd 0xc5 0xbd 0xa5 446540.0 0xd6 0xb5 … 0x94 0xad 446600.0 0xce 0xff 0x9c 0x94
This Raster behaves just like any Array in Julia. You can do math with it, or change the type.
nraster = clamp.(Float32.(raster) * 2, 100, 200)
100×100 Raster{Float32,2} with dimensions: X Projected{Float64} LinRange{Float64}(440720.0, 446660.0, 100) ForwardOrdered Regular Intervals crs: WellKnownText, Y Projected{Float64} LinRange{Float64}(3.75126e6, 3.74532e6, 100) ReverseOrdered Regular Intervals crs: WellKnownText and reference dimensions: Band Categorical{Int64} 1:1 ForwardOrdered extent: Extent(X = (440720.0, 446720.0), Y = (3.74532e6, 3.75132e6))crs: PROJCS["NAD27 / UTM zone 11N",GEOGCS["NAD27",DATUM["North_American_Datum_1927",SPHEROID["Clarke 1866",6378206.4,294.978698213898,AUTHORITY["EPSG","7008"]],AUTHORITY["EPSG","6267"]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4267"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-117],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Easting",EAST],AXIS["Northing",NORTH],AUTHORITY["EPSG","26711"]] parent: 3.75126e6 3.7512e6 3.75114e6 … 3.74538e6 3.74532e6 440720.0 200.0 200.0 200.0 132.0 200.0 440780.0 200.0 200.0 200.0 200.0 200.0 440840.0 200.0 200.0 200.0 200.0 200.0 440900.0 200.0 200.0 200.0 200.0 200.0 440960.0 200.0 200.0 200.0 … 200.0 100.0 441020.0 200.0 200.0 200.0 116.0 100.0 ⋮ ⋱ ⋮ 446360.0 200.0 200.0 200.0 200.0 200.0 446420.0 200.0 200.0 200.0 … 198.0 198.0 446480.0 200.0 200.0 200.0 164.0 164.0 446540.0 200.0 200.0 200.0 180.0 180.0 446600.0 200.0 200.0 200.0 180.0 200.0 446660.0 200.0 200.0 200.0 200.0 200.0
Saving to file is as easy as reading it
Rasters.write("test.tif", nraster)
"test.tif"
Rasters can also rasterize points, create a raster from scratch, work on NetCDF files, do zonal statistics and more. Please check the documentation https://rafaqz.github.io/Rasters.jl/stable/
Vector data¶
We can also easily open vector datasets. We will use GeoDataFrames here, a package inspired by geopandas in Python.
url = "https://github.com/OpenGeoHub/spatial-prediction-eml/blob/master/input/gbif_aedes_albopictus.gpkg?raw=true"
fn = "gbif_aedes_albopictus.gpkg"
isfile(fn) || Downloads.download(url, fn)
"gbif_aedes_albopictus.gpkg"
df = GeoDataFrames.read(fn)
Row | geom | gbifID | datasetKey | occurrenceID | kingdom | phylum | class | order | family | genus | species | infraspecificEpithet | taxonRank | scientificName | verbatimScientificName | verbatimScientificNameAuthorship | countryCode | locality | stateProvince | occurrenceStatus | individualCount | publishingOrgKey | coordinateUncertaintyInMeters | coordinatePrecision | elevation | elevationAccuracy | depth | depthAccuracy | eventDate | day | month | year | taxonKey | speciesKey | basisOfRecord | institutionCode | collectionCode | catalogNumber | recordNumber | identifiedBy | dateIdentified | license | rightsHolder | recordedBy | typeStatus | establishmentMeans | lastInterpreted | mediaType | issue | Date |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
IGeometr… | Float64 | String | String? | String | String | String | String | String | String | String | Missing | String | String | String | String? | String | String? | String? | String | Float64 | String | Float64? | Missing | Float64? | Float64? | Missing | Missing | String | Float64? | Float64? | Float64 | Float64 | Float64 | String | String? | String? | String? | Missing | String? | String? | String | String? | String? | Missing | String? | String | String? | String? | String | |
1 | Geometry: wkbPoint | 3.72352e9 | 8a863029-f435-446a-821e-275f4f641165 | https://observation.org/observation/226030224 | Animalia | Arthropoda | Insecta | Diptera | Culicidae | Aedes | Aedes albopictus | missing | SPECIES | Aedes albopictus (Skuse, 1894) | Aedes albopictus | missing | ES | Spain - Begur | missing | PRESENT | 1.0 | c8d737e0-2ff8-42e8-b8fc-6b805d26fc5f | 43.0 | missing | missing | missing | missing | missing | 2021-09-21 00:00:00 | 21.0 | 9.0 | 2021.0 | 1.65143e6 | 1.65143e6 | HUMAN_OBSERVATION | missing | Observations | OBS.226030224 | missing | missing | missing | CC_BY_NC_4_0 | Stichting Observation International | missing | missing | missing | 2022-03-24 21:07:39 | StillImage | OCCURRENCE_STATUS_INFERRED_FROM_INDIVIDUAL_COUNT | 2021-09-21 |
2 | Geometry: wkbPoint | 3.72315e9 | 8a863029-f435-446a-821e-275f4f641165 | https://observation.org/observation/229897504 | Animalia | Arthropoda | Insecta | Diptera | Culicidae | Aedes | Aedes albopictus | missing | SPECIES | Aedes albopictus (Skuse, 1894) | Aedes albopictus | missing | FR | France - Pau | missing | PRESENT | 1.0 | c8d737e0-2ff8-42e8-b8fc-6b805d26fc5f | 25.0 | missing | missing | missing | missing | missing | 2021-07-22 00:00:00 | 22.0 | 7.0 | 2021.0 | 1.65143e6 | 1.65143e6 | HUMAN_OBSERVATION | missing | Observations | OBS.229897504 | missing | missing | missing | CC_BY_NC_4_0 | Stichting Observation International | missing | missing | missing | 2022-03-24 21:21:48 | StillImage | OCCURRENCE_STATUS_INFERRED_FROM_INDIVIDUAL_COUNT | 2021-07-22 |
3 | Geometry: wkbPoint | 3.72176e9 | 8a863029-f435-446a-821e-275f4f641165 | https://observation.org/observation/222737616 | Animalia | Arthropoda | Insecta | Diptera | Culicidae | Aedes | Aedes albopictus | missing | SPECIES | Aedes albopictus (Skuse, 1894) | Aedes albopictus | missing | FR | France - Caluire-et-Cuire | missing | PRESENT | 1.0 | c8d737e0-2ff8-42e8-b8fc-6b805d26fc5f | 356.0 | missing | missing | missing | missing | missing | 2021-08-12 00:00:00 | 12.0 | 8.0 | 2021.0 | 1.65143e6 | 1.65143e6 | HUMAN_OBSERVATION | missing | Observations | OBS.222737616 | missing | missing | missing | CC_BY_NC_4_0 | Stichting Observation International | missing | missing | missing | 2022-03-24 21:01:03 | StillImage | COORDINATE_ROUNDED;OCCURRENCE_STATUS_INFERRED_FROM_INDIVIDUAL_COUNT | 2021-08-12 |
4 | Geometry: wkbPoint | 3.72142e9 | 8a863029-f435-446a-821e-275f4f641165 | https://observation.org/observation/221356176 | Animalia | Arthropoda | Insecta | Diptera | Culicidae | Aedes | Aedes albopictus | missing | SPECIES | Aedes albopictus (Skuse, 1894) | Aedes albopictus | missing | ES | Spain - Elche | missing | PRESENT | 1.0 | c8d737e0-2ff8-42e8-b8fc-6b805d26fc5f | 4.0 | missing | missing | missing | missing | missing | 2021-07-28 00:00:00 | 28.0 | 7.0 | 2021.0 | 1.65143e6 | 1.65143e6 | HUMAN_OBSERVATION | missing | Observations | OBS.221356176 | missing | missing | missing | CC_BY_NC_4_0 | Stichting Observation International | missing | missing | missing | 2022-03-24 20:56:46 | StillImage | OCCURRENCE_STATUS_INFERRED_FROM_INDIVIDUAL_COUNT | 2021-07-28 |
5 | Geometry: wkbPoint | 3.71405e9 | 03269e13-84ae-430f-990e-f11069413e36 | E-Montesacro-M5-2020-06-30-1 | Animalia | Arthropoda | Insecta | Diptera | Culicidae | Aedes | Aedes albopictus | missing | SPECIES | Aedes albopictus (Skuse, 1894) | Aedes albopictus (Skuse, 1894) | (Skuse, 1894) | IT | Montesacro | Rm | PRESENT | 10.0 | e37fc40e-0541-4ffa-8a4c-0426d73804e8 | missing | missing | missing | missing | missing | missing | 2020-06-30 00:00:00 | 30.0 | 6.0 | 2020.0 | 1.65143e6 | 1.65143e6 | HUMAN_OBSERVATION | UIB | missing | missing | missing | missing | missing | CC_BY_NC_4_0 | missing | missing | missing | Introduced | 2022-03-30 14:52:49 | missing | COORDINATE_ROUNDED;GEODETIC_DATUM_ASSUMED_WGS84 | 2020-06-30 |
6 | Geometry: wkbPoint | 3.71405e9 | 03269e13-84ae-430f-990e-f11069413e36 | E-SAR-4_200804-1 | Animalia | Arthropoda | Insecta | Diptera | Culicidae | Aedes | Aedes albopictus | missing | SPECIES | Aedes albopictus (Skuse, 1894) | Aedes albopictus (Skuse, 1894) | (Skuse, 1894) | TR | 34396 | Istanbul | PRESENT | 125.0 | e37fc40e-0541-4ffa-8a4c-0426d73804e8 | missing | missing | 105.0 | 0.0 | missing | missing | 2020-08-04 00:00:00 | 4.0 | 8.0 | 2020.0 | 1.65143e6 | 1.65143e6 | HUMAN_OBSERVATION | UIB | missing | missing | missing | missing | missing | CC_BY_NC_4_0 | missing | missing | missing | Introduced | 2022-03-30 14:52:49 | missing | GEODETIC_DATUM_ASSUMED_WGS84 | 2020-08-04 |
7 | Geometry: wkbPoint | 3.71405e9 | 03269e13-84ae-430f-990e-f11069413e36 | E_CRO_ZG_40_200612-1 | Animalia | Arthropoda | Insecta | Diptera | Culicidae | Aedes | Aedes albopictus | missing | SPECIES | Aedes albopictus (Skuse, 1894) | Aedes albopictus (Skuse, 1894) | (Skuse, 1894) | HR | Zagreb | City of Zagreb | PRESENT | 22.0 | e37fc40e-0541-4ffa-8a4c-0426d73804e8 | missing | missing | 137.0 | 0.0 | missing | missing | 2020-06-12 00:00:00 | 12.0 | 6.0 | 2020.0 | 1.65143e6 | 1.65143e6 | HUMAN_OBSERVATION | UIB | missing | missing | missing | missing | missing | CC_BY_NC_4_0 | missing | missing | missing | Introduced | 2022-03-30 14:52:49 | missing | GEODETIC_DATUM_ASSUMED_WGS84 | 2020-06-12 |
8 | Geometry: wkbPoint | 3.71405e9 | 03269e13-84ae-430f-990e-f11069413e36 | E-Montesacro-M1-2020-06-16-1 | Animalia | Arthropoda | Insecta | Diptera | Culicidae | Aedes | Aedes albopictus | missing | SPECIES | Aedes albopictus (Skuse, 1894) | Aedes albopictus (Skuse, 1894) | (Skuse, 1894) | IT | Montesacro | Rm | PRESENT | 3.0 | e37fc40e-0541-4ffa-8a4c-0426d73804e8 | missing | missing | missing | missing | missing | missing | 2020-06-16 00:00:00 | 16.0 | 6.0 | 2020.0 | 1.65143e6 | 1.65143e6 | HUMAN_OBSERVATION | UIB | missing | missing | missing | missing | missing | CC_BY_NC_4_0 | missing | missing | missing | Introduced | 2022-03-30 14:52:49 | missing | COORDINATE_ROUNDED;GEODETIC_DATUM_ASSUMED_WGS84 | 2020-06-16 |
9 | Geometry: wkbPoint | 3.71405e9 | 03269e13-84ae-430f-990e-f11069413e36 | E_SP_LesFonts_4_200902-1 | Animalia | Arthropoda | Insecta | Diptera | Culicidae | Aedes | Aedes albopictus | missing | SPECIES | Aedes albopictus (Skuse, 1894) | Aedes albopictus (Skuse, 1894) | (Skuse, 1894) | ES | Terrassa | Barcelona | PRESENT | 2.0 | e37fc40e-0541-4ffa-8a4c-0426d73804e8 | missing | missing | 220.0 | 0.0 | missing | missing | 2020-09-02 00:00:00 | 2.0 | 9.0 | 2020.0 | 1.65143e6 | 1.65143e6 | HUMAN_OBSERVATION | UIB | missing | missing | missing | missing | missing | CC_BY_NC_4_0 | missing | missing | missing | Introduced | 2022-03-30 14:52:49 | missing | GEODETIC_DATUM_ASSUMED_WGS84 | 2020-09-02 |
10 | Geometry: wkbPoint | 3.71405e9 | 03269e13-84ae-430f-990e-f11069413e36 | E_AL_SR_3_201125-1 | Animalia | Arthropoda | Insecta | Diptera | Culicidae | Aedes | Aedes albopictus | missing | SPECIES | Aedes albopictus (Skuse, 1894) | Aedes albopictus (Skuse, 1894) | (Skuse, 1894) | AL | Sarande | Sarande | PRESENT | 2.0 | e37fc40e-0541-4ffa-8a4c-0426d73804e8 | missing | missing | 22.0 | 0.0 | missing | missing | 2020-11-25 00:00:00 | 25.0 | 11.0 | 2020.0 | 1.65143e6 | 1.65143e6 | HUMAN_OBSERVATION | UIB | missing | missing | missing | missing | missing | CC_BY_NC_4_0 | missing | missing | missing | Introduced | 2022-03-30 14:52:49 | missing | GEODETIC_DATUM_ASSUMED_WGS84 | 2020-11-25 |
11 | Geometry: wkbPoint | 3.71405e9 | 03269e13-84ae-430f-990e-f11069413e36 | E-Monterotondo-C4-2020-10-20-1 | Animalia | Arthropoda | Insecta | Diptera | Culicidae | Aedes | Aedes albopictus | missing | SPECIES | Aedes albopictus (Skuse, 1894) | Aedes albopictus (Skuse, 1894) | (Skuse, 1894) | IT | Monterotondo | Rm | PRESENT | 1.0 | e37fc40e-0541-4ffa-8a4c-0426d73804e8 | missing | missing | missing | missing | missing | missing | 2020-10-20 00:00:00 | 20.0 | 10.0 | 2020.0 | 1.65143e6 | 1.65143e6 | HUMAN_OBSERVATION | UIB | missing | missing | missing | missing | missing | CC_BY_NC_4_0 | missing | missing | missing | Introduced | 2022-03-30 14:52:49 | missing | GEODETIC_DATUM_ASSUMED_WGS84 | 2020-10-20 |
12 | Geometry: wkbPoint | 3.71405e9 | 03269e13-84ae-430f-990e-f11069413e36 | A-SP-Palma-3-1-200910-1 | Animalia | Arthropoda | Insecta | Diptera | Culicidae | Aedes | Aedes albopictus | missing | SPECIES | Aedes albopictus (Skuse, 1894) | Aedes albopictus (Skuse, 1894) | (Skuse, 1894) | ES | Palma | Mallorca | PRESENT | 11.0 | e37fc40e-0541-4ffa-8a4c-0426d73804e8 | missing | missing | 20.0 | 0.0 | missing | missing | 2020-09-10 00:00:00 | 10.0 | 9.0 | 2020.0 | 1.65143e6 | 1.65143e6 | HUMAN_OBSERVATION | UIB | missing | missing | missing | missing | missing | CC_BY_NC_4_0 | missing | missing | missing | Introduced | 2022-03-30 14:52:49 | missing | COORDINATE_ROUNDED;GEODETIC_DATUM_ASSUMED_WGS84 | 2020-09-10 |
13 | Geometry: wkbPoint | 3.71405e9 | 03269e13-84ae-430f-990e-f11069413e36 | E_ETX-FU-02_200721-1 | Animalia | Arthropoda | Insecta | Diptera | Culicidae | Aedes | Aedes albopictus | missing | SPECIES | Aedes albopictus (Skuse, 1894) | Aedes albopictus (Skuse, 1894) | (Skuse, 1894) | ES | Etxebarri | Bizkaia | PRESENT | 15.0 | e37fc40e-0541-4ffa-8a4c-0426d73804e8 | missing | missing | 27.1 | 0.0 | missing | missing | 2020-07-21 00:00:00 | 21.0 | 7.0 | 2020.0 | 1.65143e6 | 1.65143e6 | HUMAN_OBSERVATION | UIB | missing | missing | missing | missing | missing | CC_BY_NC_4_0 | missing | missing | missing | Introduced | 2022-03-30 14:52:49 | missing | GEODETIC_DATUM_ASSUMED_WGS84 | 2020-07-21 |
⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ |
13892 | Geometry: wkbPoint | 1.26485e9 | 33614778-513a-4ec0-814d-125021cca5fe | 4461 | Animalia | Arthropoda | Insecta | Diptera | Culicidae | Aedes | Aedes albopictus | missing | SPECIES | Aedes albopictus (Skuse, 1894) | Aedes albopictus | missing | TR | missing | missing | PRESENT | 1.0 | 92f51af1-e917-49bc-a8ed-014ed3a77bec | missing | missing | missing | missing | missing | missing | 2011-01-01 00:00:00 | missing | missing | 2011.0 | 1.65143e6 | 1.65143e6 | MATERIAL_CITATION | missing | missing | missing | missing | missing | missing | CC0_1_0 | missing | missing | missing | missing | 2022-01-30 11:39:38 | missing | GEODETIC_DATUM_ASSUMED_WGS84;OCCURRENCE_STATUS_UNPARSABLE | 2011-01-01 |
13893 | Geometry: wkbPoint | 1.26485e9 | 33614778-513a-4ec0-814d-125021cca5fe | 4460 | Animalia | Arthropoda | Insecta | Diptera | Culicidae | Aedes | Aedes albopictus | missing | SPECIES | Aedes albopictus (Skuse, 1894) | Aedes albopictus | missing | ME | missing | missing | PRESENT | 1.0 | 92f51af1-e917-49bc-a8ed-014ed3a77bec | missing | missing | missing | missing | missing | missing | 2010-01-01 00:00:00 | missing | missing | 2010.0 | 1.65143e6 | 1.65143e6 | MATERIAL_CITATION | missing | missing | missing | missing | missing | missing | CC0_1_0 | missing | missing | missing | missing | 2022-01-30 11:39:38 | missing | GEODETIC_DATUM_ASSUMED_WGS84;OCCURRENCE_STATUS_UNPARSABLE | 2010-01-01 |
13894 | Geometry: wkbPoint | 1.22777e9 | 50c9509d-22c7-4a22-a47d-8c48425ef4a7 | http://www.inaturalist.org/observations/2533926 | Animalia | Arthropoda | Insecta | Diptera | Culicidae | Aedes | Aedes albopictus | missing | SPECIES | Aedes albopictus (Skuse, 1894) | Aedes albopictus | missing | IT | missing | Toscana | PRESENT | 1.0 | 28eb1a3f-1c15-4a95-931a-4af90ecb574d | 7.0 | missing | missing | missing | missing | missing | 2007-09-29 00:00:00 | 29.0 | 9.0 | 2007.0 | 1.65143e6 | 1.65143e6 | HUMAN_OBSERVATION | iNaturalist | Observations | 2533926 | missing | filippoceccolini | 2016-01-01 20:22:56 | CC_BY_NC_4_0 | filippoceccolini | filippoceccolini | missing | missing | 2022-04-05 23:28:48 | StillImage | missing | 2007-09-29 |
13895 | Geometry: wkbPoint | 1.14352e9 | 50c9509d-22c7-4a22-a47d-8c48425ef4a7 | http://www.inaturalist.org/observations/1881457 | Animalia | Arthropoda | Insecta | Diptera | Culicidae | Aedes | Aedes albopictus | missing | SPECIES | Aedes albopictus (Skuse, 1894) | Aedes albopictus | missing | ES | missing | Cataluña | PRESENT | 1.0 | 28eb1a3f-1c15-4a95-931a-4af90ecb574d | 25.0 | missing | missing | missing | missing | missing | 2015-08-22 06:27:57 | 22.0 | 8.0 | 2015.0 | 1.65143e6 | 1.65143e6 | HUMAN_OBSERVATION | iNaturalist | Observations | 1881457 | missing | Eduardo Martínez | 2015-08-28 21:54:44 | CC_BY_NC_4_0 | Sergio | Sergio | missing | missing | 2022-04-05 22:57:01 | StillImage | COORDINATE_ROUNDED | 2015-08-22 |
13896 | Geometry: wkbPoint | 1.02433e9 | 50c9509d-22c7-4a22-a47d-8c48425ef4a7 | http://www.inaturalist.org/observations/905732 | Animalia | Arthropoda | Insecta | Diptera | Culicidae | Aedes | Aedes albopictus | missing | SPECIES | Aedes albopictus (Skuse, 1894) | Aedes albopictus | missing | IT | missing | Veneto | PRESENT | 1.0 | 28eb1a3f-1c15-4a95-931a-4af90ecb574d | missing | missing | missing | missing | missing | missing | 2014-09-30 16:57:39 | 30.0 | 9.0 | 2014.0 | 1.65143e6 | 1.65143e6 | HUMAN_OBSERVATION | iNaturalist | Observations | 905732 | missing | Marcello Consolo | 2014-10-02 11:47:31 | CC_BY_4_0 | Marcello Consolo | Marcello Consolo | missing | missing | 2022-04-05 23:26:50 | StillImage | missing | 2014-09-30 |
13897 | Geometry: wkbPoint | 1.02422e9 | 50c9509d-22c7-4a22-a47d-8c48425ef4a7 | http://www.inaturalist.org/observations/867653 | Animalia | Arthropoda | Insecta | Diptera | Culicidae | Aedes | Aedes albopictus | missing | SPECIES | Aedes albopictus (Skuse, 1894) | Aedes albopictus | missing | ES | missing | Cataluña | PRESENT | 1.0 | 28eb1a3f-1c15-4a95-931a-4af90ecb574d | 500.0 | missing | missing | missing | missing | missing | 2014-09-08 21:27:32 | 8.0 | 9.0 | 2014.0 | 1.65143e6 | 1.65143e6 | HUMAN_OBSERVATION | iNaturalist | Observations | 867653 | missing | molluria | 2014-09-08 19:28:30 | CC_BY_NC_4_0 | molluria | molluria | missing | missing | 2022-04-05 22:56:54 | StillImage | missing | 2014-09-08 |
13898 | Geometry: wkbPoint | 1.02422e9 | 50c9509d-22c7-4a22-a47d-8c48425ef4a7 | http://www.inaturalist.org/observations/857721 | Animalia | Arthropoda | Insecta | Diptera | Culicidae | Aedes | Aedes albopictus | missing | SPECIES | Aedes albopictus (Skuse, 1894) | Aedes albopictus | missing | IT | missing | Veneto | PRESENT | 1.0 | 28eb1a3f-1c15-4a95-931a-4af90ecb574d | missing | missing | missing | missing | missing | missing | 2014-09-01 16:02:18 | 1.0 | 9.0 | 2014.0 | 1.65143e6 | 1.65143e6 | HUMAN_OBSERVATION | iNaturalist | Observations | 857721 | missing | Marcello Consolo | 2014-09-01 21:17:57 | CC_BY_4_0 | Marcello Consolo | Marcello Consolo | missing | missing | 2022-04-05 23:20:48 | StillImage | missing | 2014-09-01 |
13899 | Geometry: wkbPoint | 9.2024e8 | 6ac3f774-d9fb-4796-b3e9-92bf6c81c084 | missing | Animalia | Arthropoda | Insecta | Diptera | Culicidae | Aedes | Aedes albopictus | missing | SPECIES | Aedes albopictus (Skuse, 1894) | Aedes albopictus | missing | DE | Bischweier | missing | PRESENT | 1.0 | bb646dff-a905-4403-a49b-6d378c2cf0d9 | 250.0 | missing | missing | missing | missing | missing | 2012-06-16 00:00:00 | 16.0 | 6.0 | 2012.0 | 1.65143e6 | 1.65143e6 | HUMAN_OBSERVATION | naturgucker | naturgucker | 481639899 | missing | missing | missing | CC_BY_4_0 | missing | -430290170 | missing | missing | 2022-02-24 22:31:39 | missing | COORDINATE_ROUNDED;GEODETIC_DATUM_ASSUMED_WGS84 | 2012-06-16 |
13900 | Geometry: wkbPoint | 9.20236e8 | 6ac3f774-d9fb-4796-b3e9-92bf6c81c084 | missing | Animalia | Arthropoda | Insecta | Diptera | Culicidae | Aedes | Aedes albopictus | missing | SPECIES | Aedes albopictus (Skuse, 1894) | Aedes albopictus | missing | DE | Bischweier | missing | PRESENT | 1.0 | bb646dff-a905-4403-a49b-6d378c2cf0d9 | 250.0 | missing | missing | missing | missing | missing | 2007-05-12 00:00:00 | 12.0 | 5.0 | 2007.0 | 1.65143e6 | 1.65143e6 | HUMAN_OBSERVATION | naturgucker | naturgucker | -470102427 | missing | missing | missing | CC_BY_4_0 | missing | -430290170 | missing | missing | 2022-02-24 22:32:57 | missing | COORDINATE_ROUNDED;GEODETIC_DATUM_ASSUMED_WGS84 | 2007-05-12 |
13901 | Geometry: wkbPoint | 8.91149e8 | 50c9509d-22c7-4a22-a47d-8c48425ef4a7 | http://www.inaturalist.org/observations/258032 | Animalia | Arthropoda | Insecta | Diptera | Culicidae | Aedes | Aedes albopictus | missing | SPECIES | Aedes albopictus (Skuse, 1894) | Aedes albopictus | missing | IT | missing | Veneto | PRESENT | 1.0 | 28eb1a3f-1c15-4a95-931a-4af90ecb574d | missing | missing | missing | missing | missing | missing | 2012-09-23 00:43:47 | 23.0 | 9.0 | 2012.0 | 1.65143e6 | 1.65143e6 | HUMAN_OBSERVATION | iNaturalist | Observations | 258032 | missing | Marcello Consolo | 2013-05-07 15:46:38 | CC_BY_4_0 | Marcello Consolo | Marcello Consolo | missing | missing | 2022-04-05 23:27:15 | missing | missing | 2012-09-23 |
13902 | Geometry: wkbPoint | 8.91029e8 | 50c9509d-22c7-4a22-a47d-8c48425ef4a7 | http://www.inaturalist.org/observations/441906 | Animalia | Arthropoda | Insecta | Diptera | Culicidae | Aedes | Aedes albopictus | missing | SPECIES | Aedes albopictus (Skuse, 1894) | Aedes albopictus | missing | IT | missing | Veneto | PRESENT | 1.0 | 28eb1a3f-1c15-4a95-931a-4af90ecb574d | 1.0 | missing | missing | missing | missing | missing | 2013-10-18 17:39:28 | 18.0 | 10.0 | 2013.0 | 1.65143e6 | 1.65143e6 | HUMAN_OBSERVATION | iNaturalist | Observations | 441906 | missing | Marcello Consolo | 2013-10-27 21:08:54 | CC_BY_4_0 | Marcello Consolo | Marcello Consolo | missing | missing | 2022-04-05 22:56:55 | StillImage | missing | 2013-10-18 |
13903 | Geometry: wkbPoint | 7.68646e8 | 7a498826-f762-11e1-a439-00145eb45e9a | MCNB:MCNB-Art:MZB 2010-1153 | Animalia | Arthropoda | Insecta | Diptera | Culicidae | Aedes | Aedes albopictus | missing | SPECIES | Aedes albopictus (Skuse, 1894) | Aedes (Stegomyia) albopictus | missing | ES | missing | Barcelona | PRESENT | 1.0 | e8eada63-4a33-44aa-b2fd-4f71efb222a0 | 8633.08 | missing | 280.0 | missing | missing | missing | 2010-08-20 00:00:00 | 20.0 | 8.0 | 2010.0 | 1.65143e6 | 1.65143e6 | PRESERVED_SPECIMEN | MCNB | MCNB-Art | MZB 2010-1153 | missing | Mederos López, Jorge Luis | 2010-08-21 00:00:00 | CC_BY_4_0 | missing | Mederos López, Jorge Luis | missing | missing | 2022-02-28 13:59:54 | missing | OCCURRENCE_STATUS_INFERRED_FROM_INDIVIDUAL_COUNT;COLLECTION_MATCH_NONE;INSTITUTION_MATCH_FUZZY | 2010-08-20 |
ndf = dropmissing(df, :month)
step = 200
subr = 1:step:nrow(ndf) # this is how you make a range
plot(ndf.geom[subr], marker_z=ndf.month[subr]', c=:turbo) # don't plot all points
histogram(df.month)
We can also do geometric operations, like buffer
. Note that we operate independent from the DataFrame, just on a Vector of geometries.
plot(GeoInterface.buffer.(df.geom[subr], 10))
The astute reader will note something wrong here. We buffered with 10
, but what unit is that? The distance is in the coordinate system, which is latitude/longitude here (some form of WGS84). If you expected something in meters, all answers will be wrong. Julia expects some responsibility from the user here (and in general).
DataFrames.metadata(df) # no CRS(!) defined for this geopackage
Dict{String, Union{Nothing, Tuple{Symbol}}} with 2 entries: "geometrycolumns" => (:geom,) "crs" => nothing
Proj¶
Let's use the Proj package to project some data.
Pkg.add("Proj")
using Proj
Resolving package versions... Installed Proj ─ v1.4.0 Updating `C:\Users\Leonie Lokal\.julia\environments\v1.9\Project.toml` [c94c279d] + Proj v1.4.0 Updating `C:\Users\Leonie Lokal\.julia\environments\v1.9\Manifest.toml` [c94c279d] + Proj v1.4.0 Precompiling project... ✓ Proj 1 dependency successfully precompiled in 3 seconds. 292 already precompiled.
trans = Proj.Transformation("EPSG:4326", "+proj=utm +zone=31 +datum=WGS84")
Transformation pipeline description: axis order change (2D) + UTM zone 31N definition: proj=pipeline step proj=axisswap order=2,1 step proj=unitconvert xy_in=deg xy_out=rad step proj=utm zone=31 ellps=WGS84 direction: forward
@. trans(GeoInterface.coordinates(df.geom)) # Open PR to not need the GeoInterface here
13903-element Vector{Tuple{Float64, Float64}}: (5.209376604186281e6, 456552.49739319785) (5.412241069392667e6, -50731.29295413459) (5.754713873198218e6, 733179.8932641628) (4.68187355543689e6, -87588.90154608067) (5.080960560416632e6, 1.798244832580825e6) (4.365457390064061e6, 3.9054092442464735e6) (5.487505153230741e6, 2.350489741186236e6) (5.082739701223782e6, 1.799398637696565e6) (5.150989731892225e6, 288756.27863756026) (4.573765250143256e6, 2.7094693606671216e6) (5.078039242256528e6, 1.8109702117222908e6) (4.870748849152667e6, 361067.96092195663) (5.394598021868791e6, -419992.2062797706) ⋮ (4.487757221573868e6, 3.5960106434823587e6) (4.947812193001832e6, 2.724578586965682e6) (5.343704296345204e6, 1.6325303912099127e6) (5.171601017402769e6, 391407.8382243044) (5.5555960208923435e6, 1.7709453930896844e6) (5.109021046712543e6, 243357.92512239376) (5.5555960208923435e6, 1.7709453930896844e6) (6.161726404212961e6, 1.3077580635600183e6) (6.161726404212961e6, 1.3077580635600183e6) (5.55561653002505e6, 1.7709315733399887e6) (5.555608215072476e6, 1.7709450061190184e6) (5.131854397338626e6, 304168.2568917704)
Now let's also write some data again. In the 2022 summer school, we hit a snag by trying to write this DataFrame again.
ofn = "test.geojson"
GeoDataFrames.write(ofn, df; geom_column=(:geom), options=Dict("OVERWRITE"=>"YES"))
MethodError: Cannot `convert` an object of type Type{Missing} to an object of type ArchGDAL.OGRFieldType Closest candidates are: convert(::Type{ArchGDAL.OGRFieldType}, ::Type{<:Enum{T}}) where T @ ArchGDAL C:\Users\Leonie Lokal\.julia\packages\ArchGDAL\R3wJR\src\types.jl:371 convert(::Type{ArchGDAL.OGRFieldType}, ::GDAL.OGRFieldType) @ ArchGDAL C:\Users\Leonie Lokal\.julia\packages\ArchGDAL\R3wJR\src\utils.jl:163 convert(::Type{ArchGDAL.OGRFieldType}, ::Type{UInt32}) @ ArchGDAL C:\Users\Leonie Lokal\.julia\packages\ArchGDAL\R3wJR\src\utils.jl:142 ... Stacktrace: [1] (::GeoDataFrames.var"#20#25"{ArchGDAL.Dataset, String, Dict{String, String}, Vector{Tuple{Symbol, DataType}}, Vector{Any}, DataFrames.DataFrameRows{DataFrame}})(layer::ArchGDAL.FeatureLayer) @ GeoDataFrames C:\Users\Leonie Lokal\.julia\packages\GeoDataFrames\HubJA\src\io.jl:147 [2] createlayer(::GeoDataFrames.var"#20#25"{ArchGDAL.Dataset, String, Dict{String, String}, Vector{Tuple{Symbol, DataType}}, Vector{Any}, DataFrames.DataFrameRows{DataFrame}}; kwargs::Base.Pairs{Symbol, Any, NTuple{4, Symbol}, NamedTuple{(:name, :geom, :spatialref, :options), Tuple{String, ArchGDAL.OGRwkbGeometryType, ArchGDAL.SpatialRef, Vector{String}}}}) @ ArchGDAL C:\Users\Leonie Lokal\.julia\packages\ArchGDAL\R3wJR\src\context.jl:267 [3] (::GeoDataFrames.var"#19#24"{ArchGDAL.Dataset, String, Nothing, Dict{String, String}, Vector{Tuple{Symbol, DataType}}, Vector{Any}, DataFrames.DataFrameRows{DataFrame}})(spatialref::ArchGDAL.SpatialRef) @ GeoDataFrames C:\Users\Leonie Lokal\.julia\packages\GeoDataFrames\HubJA\src\io.jl:135 [4] newspatialref(::GeoDataFrames.var"#19#24"{ArchGDAL.Dataset, String, Nothing, Dict{String, String}, Vector{Tuple{Symbol, DataType}}, Vector{Any}, DataFrames.DataFrameRows{DataFrame}}; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}) @ ArchGDAL C:\Users\Leonie Lokal\.julia\packages\ArchGDAL\R3wJR\src\context.jl:267 [5] newspatialref @ C:\Users\Leonie Lokal\.julia\packages\ArchGDAL\R3wJR\src\context.jl:264 [inlined] [6] #18 @ C:\Users\Leonie Lokal\.julia\packages\GeoDataFrames\HubJA\src\io.jl:133 [inlined] [7] create(f::GeoDataFrames.var"#18#23"{String, Nothing, Dict{String, String}, Vector{Tuple{Symbol, DataType}}, Vector{Any}, DataFrames.DataFrameRows{DataFrame}}, args::String; kwargs::Base.Pairs{Symbol, ArchGDAL.Driver, Tuple{Symbol}, NamedTuple{(:driver,), Tuple{ArchGDAL.Driver}}}) @ ArchGDAL C:\Users\Leonie Lokal\.julia\packages\ArchGDAL\R3wJR\src\context.jl:267 [8] create @ C:\Users\Leonie Lokal\.julia\packages\ArchGDAL\R3wJR\src\context.jl:264 [inlined] [9] write(fn::String, table::DataFrame; layer_name::String, crs::Nothing, driver::Nothing, options::Dict{String, String}, geom_columns::Tuple{Symbol}, kwargs::Base.Pairs{Symbol, Symbol, Tuple{Symbol}, NamedTuple{(:geom_column,), Tuple{Symbol}}}) @ GeoDataFrames C:\Users\Leonie Lokal\.julia\packages\GeoDataFrames\HubJA\src\io.jl:129 [10] top-level scope @ In[23]:2
using DataFrames
columns = String[]
for (column, type) in (zip(names(df), eltype.(eachcol(df))))
type isa Type{Missing} && push!(columns, column)
end
@info columns
sdf = df[!, Not(columns)]
[ Info: ["infraspecificEpithet", "coordinatePrecision", "depth", "depthAccuracy", "recordNumber", "typeStatus"]
Row | geom | gbifID | datasetKey | occurrenceID | kingdom | phylum | class | order | family | genus | species | taxonRank | scientificName | verbatimScientificName | verbatimScientificNameAuthorship | countryCode | locality | stateProvince | occurrenceStatus | individualCount | publishingOrgKey | coordinateUncertaintyInMeters | elevation | elevationAccuracy | eventDate | day | month | year | taxonKey | speciesKey | basisOfRecord | institutionCode | collectionCode | catalogNumber | identifiedBy | dateIdentified | license | rightsHolder | recordedBy | establishmentMeans | lastInterpreted | mediaType | issue | Date |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
IGeometr… | Float64 | String | String? | String | String | String | String | String | String | String | String | String | String | String? | String | String? | String? | String | Float64 | String | Float64? | Float64? | Float64? | String | Float64? | Float64? | Float64 | Float64 | Float64 | String | String? | String? | String? | String? | String? | String | String? | String? | String? | String | String? | String? | String | |
1 | Geometry: wkbPoint | 3.72352e9 | 8a863029-f435-446a-821e-275f4f641165 | https://observation.org/observation/226030224 | Animalia | Arthropoda | Insecta | Diptera | Culicidae | Aedes | Aedes albopictus | SPECIES | Aedes albopictus (Skuse, 1894) | Aedes albopictus | missing | ES | Spain - Begur | missing | PRESENT | 1.0 | c8d737e0-2ff8-42e8-b8fc-6b805d26fc5f | 43.0 | missing | missing | 2021-09-21 00:00:00 | 21.0 | 9.0 | 2021.0 | 1.65143e6 | 1.65143e6 | HUMAN_OBSERVATION | missing | Observations | OBS.226030224 | missing | missing | CC_BY_NC_4_0 | Stichting Observation International | missing | missing | 2022-03-24 21:07:39 | StillImage | OCCURRENCE_STATUS_INFERRED_FROM_INDIVIDUAL_COUNT | 2021-09-21 |
2 | Geometry: wkbPoint | 3.72315e9 | 8a863029-f435-446a-821e-275f4f641165 | https://observation.org/observation/229897504 | Animalia | Arthropoda | Insecta | Diptera | Culicidae | Aedes | Aedes albopictus | SPECIES | Aedes albopictus (Skuse, 1894) | Aedes albopictus | missing | FR | France - Pau | missing | PRESENT | 1.0 | c8d737e0-2ff8-42e8-b8fc-6b805d26fc5f | 25.0 | missing | missing | 2021-07-22 00:00:00 | 22.0 | 7.0 | 2021.0 | 1.65143e6 | 1.65143e6 | HUMAN_OBSERVATION | missing | Observations | OBS.229897504 | missing | missing | CC_BY_NC_4_0 | Stichting Observation International | missing | missing | 2022-03-24 21:21:48 | StillImage | OCCURRENCE_STATUS_INFERRED_FROM_INDIVIDUAL_COUNT | 2021-07-22 |
3 | Geometry: wkbPoint | 3.72176e9 | 8a863029-f435-446a-821e-275f4f641165 | https://observation.org/observation/222737616 | Animalia | Arthropoda | Insecta | Diptera | Culicidae | Aedes | Aedes albopictus | SPECIES | Aedes albopictus (Skuse, 1894) | Aedes albopictus | missing | FR | France - Caluire-et-Cuire | missing | PRESENT | 1.0 | c8d737e0-2ff8-42e8-b8fc-6b805d26fc5f | 356.0 | missing | missing | 2021-08-12 00:00:00 | 12.0 | 8.0 | 2021.0 | 1.65143e6 | 1.65143e6 | HUMAN_OBSERVATION | missing | Observations | OBS.222737616 | missing | missing | CC_BY_NC_4_0 | Stichting Observation International | missing | missing | 2022-03-24 21:01:03 | StillImage | COORDINATE_ROUNDED;OCCURRENCE_STATUS_INFERRED_FROM_INDIVIDUAL_COUNT | 2021-08-12 |
4 | Geometry: wkbPoint | 3.72142e9 | 8a863029-f435-446a-821e-275f4f641165 | https://observation.org/observation/221356176 | Animalia | Arthropoda | Insecta | Diptera | Culicidae | Aedes | Aedes albopictus | SPECIES | Aedes albopictus (Skuse, 1894) | Aedes albopictus | missing | ES | Spain - Elche | missing | PRESENT | 1.0 | c8d737e0-2ff8-42e8-b8fc-6b805d26fc5f | 4.0 | missing | missing | 2021-07-28 00:00:00 | 28.0 | 7.0 | 2021.0 | 1.65143e6 | 1.65143e6 | HUMAN_OBSERVATION | missing | Observations | OBS.221356176 | missing | missing | CC_BY_NC_4_0 | Stichting Observation International | missing | missing | 2022-03-24 20:56:46 | StillImage | OCCURRENCE_STATUS_INFERRED_FROM_INDIVIDUAL_COUNT | 2021-07-28 |
5 | Geometry: wkbPoint | 3.71405e9 | 03269e13-84ae-430f-990e-f11069413e36 | E-Montesacro-M5-2020-06-30-1 | Animalia | Arthropoda | Insecta | Diptera | Culicidae | Aedes | Aedes albopictus | SPECIES | Aedes albopictus (Skuse, 1894) | Aedes albopictus (Skuse, 1894) | (Skuse, 1894) | IT | Montesacro | Rm | PRESENT | 10.0 | e37fc40e-0541-4ffa-8a4c-0426d73804e8 | missing | missing | missing | 2020-06-30 00:00:00 | 30.0 | 6.0 | 2020.0 | 1.65143e6 | 1.65143e6 | HUMAN_OBSERVATION | UIB | missing | missing | missing | missing | CC_BY_NC_4_0 | missing | missing | Introduced | 2022-03-30 14:52:49 | missing | COORDINATE_ROUNDED;GEODETIC_DATUM_ASSUMED_WGS84 | 2020-06-30 |
6 | Geometry: wkbPoint | 3.71405e9 | 03269e13-84ae-430f-990e-f11069413e36 | E-SAR-4_200804-1 | Animalia | Arthropoda | Insecta | Diptera | Culicidae | Aedes | Aedes albopictus | SPECIES | Aedes albopictus (Skuse, 1894) | Aedes albopictus (Skuse, 1894) | (Skuse, 1894) | TR | 34396 | Istanbul | PRESENT | 125.0 | e37fc40e-0541-4ffa-8a4c-0426d73804e8 | missing | 105.0 | 0.0 | 2020-08-04 00:00:00 | 4.0 | 8.0 | 2020.0 | 1.65143e6 | 1.65143e6 | HUMAN_OBSERVATION | UIB | missing | missing | missing | missing | CC_BY_NC_4_0 | missing | missing | Introduced | 2022-03-30 14:52:49 | missing | GEODETIC_DATUM_ASSUMED_WGS84 | 2020-08-04 |
7 | Geometry: wkbPoint | 3.71405e9 | 03269e13-84ae-430f-990e-f11069413e36 | E_CRO_ZG_40_200612-1 | Animalia | Arthropoda | Insecta | Diptera | Culicidae | Aedes | Aedes albopictus | SPECIES | Aedes albopictus (Skuse, 1894) | Aedes albopictus (Skuse, 1894) | (Skuse, 1894) | HR | Zagreb | City of Zagreb | PRESENT | 22.0 | e37fc40e-0541-4ffa-8a4c-0426d73804e8 | missing | 137.0 | 0.0 | 2020-06-12 00:00:00 | 12.0 | 6.0 | 2020.0 | 1.65143e6 | 1.65143e6 | HUMAN_OBSERVATION | UIB | missing | missing | missing | missing | CC_BY_NC_4_0 | missing | missing | Introduced | 2022-03-30 14:52:49 | missing | GEODETIC_DATUM_ASSUMED_WGS84 | 2020-06-12 |
8 | Geometry: wkbPoint | 3.71405e9 | 03269e13-84ae-430f-990e-f11069413e36 | E-Montesacro-M1-2020-06-16-1 | Animalia | Arthropoda | Insecta | Diptera | Culicidae | Aedes | Aedes albopictus | SPECIES | Aedes albopictus (Skuse, 1894) | Aedes albopictus (Skuse, 1894) | (Skuse, 1894) | IT | Montesacro | Rm | PRESENT | 3.0 | e37fc40e-0541-4ffa-8a4c-0426d73804e8 | missing | missing | missing | 2020-06-16 00:00:00 | 16.0 | 6.0 | 2020.0 | 1.65143e6 | 1.65143e6 | HUMAN_OBSERVATION | UIB | missing | missing | missing | missing | CC_BY_NC_4_0 | missing | missing | Introduced | 2022-03-30 14:52:49 | missing | COORDINATE_ROUNDED;GEODETIC_DATUM_ASSUMED_WGS84 | 2020-06-16 |
9 | Geometry: wkbPoint | 3.71405e9 | 03269e13-84ae-430f-990e-f11069413e36 | E_SP_LesFonts_4_200902-1 | Animalia | Arthropoda | Insecta | Diptera | Culicidae | Aedes | Aedes albopictus | SPECIES | Aedes albopictus (Skuse, 1894) | Aedes albopictus (Skuse, 1894) | (Skuse, 1894) | ES | Terrassa | Barcelona | PRESENT | 2.0 | e37fc40e-0541-4ffa-8a4c-0426d73804e8 | missing | 220.0 | 0.0 | 2020-09-02 00:00:00 | 2.0 | 9.0 | 2020.0 | 1.65143e6 | 1.65143e6 | HUMAN_OBSERVATION | UIB | missing | missing | missing | missing | CC_BY_NC_4_0 | missing | missing | Introduced | 2022-03-30 14:52:49 | missing | GEODETIC_DATUM_ASSUMED_WGS84 | 2020-09-02 |
10 | Geometry: wkbPoint | 3.71405e9 | 03269e13-84ae-430f-990e-f11069413e36 | E_AL_SR_3_201125-1 | Animalia | Arthropoda | Insecta | Diptera | Culicidae | Aedes | Aedes albopictus | SPECIES | Aedes albopictus (Skuse, 1894) | Aedes albopictus (Skuse, 1894) | (Skuse, 1894) | AL | Sarande | Sarande | PRESENT | 2.0 | e37fc40e-0541-4ffa-8a4c-0426d73804e8 | missing | 22.0 | 0.0 | 2020-11-25 00:00:00 | 25.0 | 11.0 | 2020.0 | 1.65143e6 | 1.65143e6 | HUMAN_OBSERVATION | UIB | missing | missing | missing | missing | CC_BY_NC_4_0 | missing | missing | Introduced | 2022-03-30 14:52:49 | missing | GEODETIC_DATUM_ASSUMED_WGS84 | 2020-11-25 |
11 | Geometry: wkbPoint | 3.71405e9 | 03269e13-84ae-430f-990e-f11069413e36 | E-Monterotondo-C4-2020-10-20-1 | Animalia | Arthropoda | Insecta | Diptera | Culicidae | Aedes | Aedes albopictus | SPECIES | Aedes albopictus (Skuse, 1894) | Aedes albopictus (Skuse, 1894) | (Skuse, 1894) | IT | Monterotondo | Rm | PRESENT | 1.0 | e37fc40e-0541-4ffa-8a4c-0426d73804e8 | missing | missing | missing | 2020-10-20 00:00:00 | 20.0 | 10.0 | 2020.0 | 1.65143e6 | 1.65143e6 | HUMAN_OBSERVATION | UIB | missing | missing | missing | missing | CC_BY_NC_4_0 | missing | missing | Introduced | 2022-03-30 14:52:49 | missing | GEODETIC_DATUM_ASSUMED_WGS84 | 2020-10-20 |
12 | Geometry: wkbPoint | 3.71405e9 | 03269e13-84ae-430f-990e-f11069413e36 | A-SP-Palma-3-1-200910-1 | Animalia | Arthropoda | Insecta | Diptera | Culicidae | Aedes | Aedes albopictus | SPECIES | Aedes albopictus (Skuse, 1894) | Aedes albopictus (Skuse, 1894) | (Skuse, 1894) | ES | Palma | Mallorca | PRESENT | 11.0 | e37fc40e-0541-4ffa-8a4c-0426d73804e8 | missing | 20.0 | 0.0 | 2020-09-10 00:00:00 | 10.0 | 9.0 | 2020.0 | 1.65143e6 | 1.65143e6 | HUMAN_OBSERVATION | UIB | missing | missing | missing | missing | CC_BY_NC_4_0 | missing | missing | Introduced | 2022-03-30 14:52:49 | missing | COORDINATE_ROUNDED;GEODETIC_DATUM_ASSUMED_WGS84 | 2020-09-10 |
13 | Geometry: wkbPoint | 3.71405e9 | 03269e13-84ae-430f-990e-f11069413e36 | E_ETX-FU-02_200721-1 | Animalia | Arthropoda | Insecta | Diptera | Culicidae | Aedes | Aedes albopictus | SPECIES | Aedes albopictus (Skuse, 1894) | Aedes albopictus (Skuse, 1894) | (Skuse, 1894) | ES | Etxebarri | Bizkaia | PRESENT | 15.0 | e37fc40e-0541-4ffa-8a4c-0426d73804e8 | missing | 27.1 | 0.0 | 2020-07-21 00:00:00 | 21.0 | 7.0 | 2020.0 | 1.65143e6 | 1.65143e6 | HUMAN_OBSERVATION | UIB | missing | missing | missing | missing | CC_BY_NC_4_0 | missing | missing | Introduced | 2022-03-30 14:52:49 | missing | GEODETIC_DATUM_ASSUMED_WGS84 | 2020-07-21 |
⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ |
13892 | Geometry: wkbPoint | 1.26485e9 | 33614778-513a-4ec0-814d-125021cca5fe | 4461 | Animalia | Arthropoda | Insecta | Diptera | Culicidae | Aedes | Aedes albopictus | SPECIES | Aedes albopictus (Skuse, 1894) | Aedes albopictus | missing | TR | missing | missing | PRESENT | 1.0 | 92f51af1-e917-49bc-a8ed-014ed3a77bec | missing | missing | missing | 2011-01-01 00:00:00 | missing | missing | 2011.0 | 1.65143e6 | 1.65143e6 | MATERIAL_CITATION | missing | missing | missing | missing | missing | CC0_1_0 | missing | missing | missing | 2022-01-30 11:39:38 | missing | GEODETIC_DATUM_ASSUMED_WGS84;OCCURRENCE_STATUS_UNPARSABLE | 2011-01-01 |
13893 | Geometry: wkbPoint | 1.26485e9 | 33614778-513a-4ec0-814d-125021cca5fe | 4460 | Animalia | Arthropoda | Insecta | Diptera | Culicidae | Aedes | Aedes albopictus | SPECIES | Aedes albopictus (Skuse, 1894) | Aedes albopictus | missing | ME | missing | missing | PRESENT | 1.0 | 92f51af1-e917-49bc-a8ed-014ed3a77bec | missing | missing | missing | 2010-01-01 00:00:00 | missing | missing | 2010.0 | 1.65143e6 | 1.65143e6 | MATERIAL_CITATION | missing | missing | missing | missing | missing | CC0_1_0 | missing | missing | missing | 2022-01-30 11:39:38 | missing | GEODETIC_DATUM_ASSUMED_WGS84;OCCURRENCE_STATUS_UNPARSABLE | 2010-01-01 |
13894 | Geometry: wkbPoint | 1.22777e9 | 50c9509d-22c7-4a22-a47d-8c48425ef4a7 | http://www.inaturalist.org/observations/2533926 | Animalia | Arthropoda | Insecta | Diptera | Culicidae | Aedes | Aedes albopictus | SPECIES | Aedes albopictus (Skuse, 1894) | Aedes albopictus | missing | IT | missing | Toscana | PRESENT | 1.0 | 28eb1a3f-1c15-4a95-931a-4af90ecb574d | 7.0 | missing | missing | 2007-09-29 00:00:00 | 29.0 | 9.0 | 2007.0 | 1.65143e6 | 1.65143e6 | HUMAN_OBSERVATION | iNaturalist | Observations | 2533926 | filippoceccolini | 2016-01-01 20:22:56 | CC_BY_NC_4_0 | filippoceccolini | filippoceccolini | missing | 2022-04-05 23:28:48 | StillImage | missing | 2007-09-29 |
13895 | Geometry: wkbPoint | 1.14352e9 | 50c9509d-22c7-4a22-a47d-8c48425ef4a7 | http://www.inaturalist.org/observations/1881457 | Animalia | Arthropoda | Insecta | Diptera | Culicidae | Aedes | Aedes albopictus | SPECIES | Aedes albopictus (Skuse, 1894) | Aedes albopictus | missing | ES | missing | Cataluña | PRESENT | 1.0 | 28eb1a3f-1c15-4a95-931a-4af90ecb574d | 25.0 | missing | missing | 2015-08-22 06:27:57 | 22.0 | 8.0 | 2015.0 | 1.65143e6 | 1.65143e6 | HUMAN_OBSERVATION | iNaturalist | Observations | 1881457 | Eduardo Martínez | 2015-08-28 21:54:44 | CC_BY_NC_4_0 | Sergio | Sergio | missing | 2022-04-05 22:57:01 | StillImage | COORDINATE_ROUNDED | 2015-08-22 |
13896 | Geometry: wkbPoint | 1.02433e9 | 50c9509d-22c7-4a22-a47d-8c48425ef4a7 | http://www.inaturalist.org/observations/905732 | Animalia | Arthropoda | Insecta | Diptera | Culicidae | Aedes | Aedes albopictus | SPECIES | Aedes albopictus (Skuse, 1894) | Aedes albopictus | missing | IT | missing | Veneto | PRESENT | 1.0 | 28eb1a3f-1c15-4a95-931a-4af90ecb574d | missing | missing | missing | 2014-09-30 16:57:39 | 30.0 | 9.0 | 2014.0 | 1.65143e6 | 1.65143e6 | HUMAN_OBSERVATION | iNaturalist | Observations | 905732 | Marcello Consolo | 2014-10-02 11:47:31 | CC_BY_4_0 | Marcello Consolo | Marcello Consolo | missing | 2022-04-05 23:26:50 | StillImage | missing | 2014-09-30 |
13897 | Geometry: wkbPoint | 1.02422e9 | 50c9509d-22c7-4a22-a47d-8c48425ef4a7 | http://www.inaturalist.org/observations/867653 | Animalia | Arthropoda | Insecta | Diptera | Culicidae | Aedes | Aedes albopictus | SPECIES | Aedes albopictus (Skuse, 1894) | Aedes albopictus | missing | ES | missing | Cataluña | PRESENT | 1.0 | 28eb1a3f-1c15-4a95-931a-4af90ecb574d | 500.0 | missing | missing | 2014-09-08 21:27:32 | 8.0 | 9.0 | 2014.0 | 1.65143e6 | 1.65143e6 | HUMAN_OBSERVATION | iNaturalist | Observations | 867653 | molluria | 2014-09-08 19:28:30 | CC_BY_NC_4_0 | molluria | molluria | missing | 2022-04-05 22:56:54 | StillImage | missing | 2014-09-08 |
13898 | Geometry: wkbPoint | 1.02422e9 | 50c9509d-22c7-4a22-a47d-8c48425ef4a7 | http://www.inaturalist.org/observations/857721 | Animalia | Arthropoda | Insecta | Diptera | Culicidae | Aedes | Aedes albopictus | SPECIES | Aedes albopictus (Skuse, 1894) | Aedes albopictus | missing | IT | missing | Veneto | PRESENT | 1.0 | 28eb1a3f-1c15-4a95-931a-4af90ecb574d | missing | missing | missing | 2014-09-01 16:02:18 | 1.0 | 9.0 | 2014.0 | 1.65143e6 | 1.65143e6 | HUMAN_OBSERVATION | iNaturalist | Observations | 857721 | Marcello Consolo | 2014-09-01 21:17:57 | CC_BY_4_0 | Marcello Consolo | Marcello Consolo | missing | 2022-04-05 23:20:48 | StillImage | missing | 2014-09-01 |
13899 | Geometry: wkbPoint | 9.2024e8 | 6ac3f774-d9fb-4796-b3e9-92bf6c81c084 | missing | Animalia | Arthropoda | Insecta | Diptera | Culicidae | Aedes | Aedes albopictus | SPECIES | Aedes albopictus (Skuse, 1894) | Aedes albopictus | missing | DE | Bischweier | missing | PRESENT | 1.0 | bb646dff-a905-4403-a49b-6d378c2cf0d9 | 250.0 | missing | missing | 2012-06-16 00:00:00 | 16.0 | 6.0 | 2012.0 | 1.65143e6 | 1.65143e6 | HUMAN_OBSERVATION | naturgucker | naturgucker | 481639899 | missing | missing | CC_BY_4_0 | missing | -430290170 | missing | 2022-02-24 22:31:39 | missing | COORDINATE_ROUNDED;GEODETIC_DATUM_ASSUMED_WGS84 | 2012-06-16 |
13900 | Geometry: wkbPoint | 9.20236e8 | 6ac3f774-d9fb-4796-b3e9-92bf6c81c084 | missing | Animalia | Arthropoda | Insecta | Diptera | Culicidae | Aedes | Aedes albopictus | SPECIES | Aedes albopictus (Skuse, 1894) | Aedes albopictus | missing | DE | Bischweier | missing | PRESENT | 1.0 | bb646dff-a905-4403-a49b-6d378c2cf0d9 | 250.0 | missing | missing | 2007-05-12 00:00:00 | 12.0 | 5.0 | 2007.0 | 1.65143e6 | 1.65143e6 | HUMAN_OBSERVATION | naturgucker | naturgucker | -470102427 | missing | missing | CC_BY_4_0 | missing | -430290170 | missing | 2022-02-24 22:32:57 | missing | COORDINATE_ROUNDED;GEODETIC_DATUM_ASSUMED_WGS84 | 2007-05-12 |
13901 | Geometry: wkbPoint | 8.91149e8 | 50c9509d-22c7-4a22-a47d-8c48425ef4a7 | http://www.inaturalist.org/observations/258032 | Animalia | Arthropoda | Insecta | Diptera | Culicidae | Aedes | Aedes albopictus | SPECIES | Aedes albopictus (Skuse, 1894) | Aedes albopictus | missing | IT | missing | Veneto | PRESENT | 1.0 | 28eb1a3f-1c15-4a95-931a-4af90ecb574d | missing | missing | missing | 2012-09-23 00:43:47 | 23.0 | 9.0 | 2012.0 | 1.65143e6 | 1.65143e6 | HUMAN_OBSERVATION | iNaturalist | Observations | 258032 | Marcello Consolo | 2013-05-07 15:46:38 | CC_BY_4_0 | Marcello Consolo | Marcello Consolo | missing | 2022-04-05 23:27:15 | missing | missing | 2012-09-23 |
13902 | Geometry: wkbPoint | 8.91029e8 | 50c9509d-22c7-4a22-a47d-8c48425ef4a7 | http://www.inaturalist.org/observations/441906 | Animalia | Arthropoda | Insecta | Diptera | Culicidae | Aedes | Aedes albopictus | SPECIES | Aedes albopictus (Skuse, 1894) | Aedes albopictus | missing | IT | missing | Veneto | PRESENT | 1.0 | 28eb1a3f-1c15-4a95-931a-4af90ecb574d | 1.0 | missing | missing | 2013-10-18 17:39:28 | 18.0 | 10.0 | 2013.0 | 1.65143e6 | 1.65143e6 | HUMAN_OBSERVATION | iNaturalist | Observations | 441906 | Marcello Consolo | 2013-10-27 21:08:54 | CC_BY_4_0 | Marcello Consolo | Marcello Consolo | missing | 2022-04-05 22:56:55 | StillImage | missing | 2013-10-18 |
13903 | Geometry: wkbPoint | 7.68646e8 | 7a498826-f762-11e1-a439-00145eb45e9a | MCNB:MCNB-Art:MZB 2010-1153 | Animalia | Arthropoda | Insecta | Diptera | Culicidae | Aedes | Aedes albopictus | SPECIES | Aedes albopictus (Skuse, 1894) | Aedes (Stegomyia) albopictus | missing | ES | missing | Barcelona | PRESENT | 1.0 | e8eada63-4a33-44aa-b2fd-4f71efb222a0 | 8633.08 | 280.0 | missing | 2010-08-20 00:00:00 | 20.0 | 8.0 | 2010.0 | 1.65143e6 | 1.65143e6 | PRESERVED_SPECIMEN | MCNB | MCNB-Art | MZB 2010-1153 | Mederos López, Jorge Luis | 2010-08-21 00:00:00 | CC_BY_4_0 | missing | Mederos López, Jorge Luis | missing | 2022-02-28 13:59:54 | missing | OCCURRENCE_STATUS_INFERRED_FROM_INDIVIDUAL_COUNT;COLLECTION_MATCH_NONE;INSTITUTION_MATCH_FUZZY | 2010-08-20 |
isfile(ofn) && rm(ofn) # GDAL can't overwrite GeoJSON files...
GeoDataFrames.write(ofn, sdf; geom_column=(:geom))
"test.geojson"
We can read a textfile from disk by using read
.
String(read(ofn))
"{\n\"type\": \"FeatureCollection\",\n\"name\": \"data\",\n\"features\": [\n{ \"type\": \"Feature\", \"id\": 0, \"properties\": { \"gbifID\": 3723517781.0, \"datasetKey\": \"8a863029-f435-446a-821e-275f4f641165\", \"occurrenceID\": \"https://observation.org/observation/226030224\", \"kingdom\": \"Animal" ⋯ 20362681 bytes ⋯ ", \"lastInterpreted\": \"2022-02-28 13:59:54\", \"mediaType\": null, \"issue\": \"OCCURRENCE_STATUS_INFERRED_FROM_INDIVIDUAL_COUNT;COLLECTION_MATCH_NONE;INSTITUTION_MATCH_FUZZY\", \"Date\": \"2010-08-20\" }, \"geometry\": { \"type\": \"Point\", \"coordinates\": [ 2.1529, 41.3937 ] } }\n]\n}\n"
There are many other pure (i.e. not depending on another library like GDAL) Julia readers of such data. For example, the above can be read with GeoJSON.jl. There's also ShapeFile.jl, GeoParquet.jl and we are working on a GeoArrow.jl one.
using Pkg
Pkg.add("GeoJSON")
import GeoJSON as GJ # Rasters also defines a GeoJSON
Resolving package versions... No Changes to `~/code/Project.toml` No Changes to `~/code/Manifest.toml`
fc = GJ.read(read(ofn))
FeatureCollection with 13903 Features
fcg = fc.geometry # check autocomplete with TAB(!)
13903-element Vector{GeoJSON.Point{2, Float32}}: 2D Point 2D Point 2D Point 2D Point 2D Point 2D Point 2D Point 2D Point 2D Point 2D Point 2D Point 2D Point 2D Point ⋮ 2D Point 2D Point 2D Point 2D Point 2D Point 2D Point 2D Point 2D Point 2D Point 2D Point 2D Point 2D Point
jdf = DataFrame(fc)
Row | verbatimScientificName | license | rightsHolder | lastInterpreted | species | elevationAccuracy | institutionCode | speciesKey | eventDate | verbatimScientificNameAuthorship | publishingOrgKey | dateIdentified | scientificName | locality | coordinateUncertaintyInMeters | Date | identifiedBy | individualCount | basisOfRecord | class | kingdom | datasetKey | establishmentMeans | mediaType | gbifID | taxonKey | issue | elevation | day | stateProvince | occurrenceID | genus | geometry | occurrenceStatus | phylum | countryCode | collectionCode | year | order | taxonRank | recordedBy | catalogNumber | family | month |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
String | String | String? | String | String | Int64? | String? | Int64 | String | String? | String | String? | String | String? | Union…? | String | String? | Int64 | String | String | String | String | String? | String? | Int64 | Int64 | String? | Union…? | Int64? | String? | String? | String | Point… | String | String | String | String? | Int64 | String | String | String? | String? | String | Int64? | |
1 | Aedes albopictus | CC_BY_NC_4_0 | Stichting Observation International | 2022-03-24 21:07:39 | Aedes albopictus | missing | missing | 1651430 | 2021-09-21 00:00:00 | missing | c8d737e0-2ff8-42e8-b8fc-6b805d26fc5f | missing | Aedes albopictus (Skuse, 1894) | Spain - Begur | 43 | 2021-09-21 | missing | 1 | HUMAN_OBSERVATION | Insecta | Animalia | 8a863029-f435-446a-821e-275f4f641165 | missing | StillImage | 3723517781 | 1651430 | OCCURRENCE_STATUS_INFERRED_FROM_INDIVIDUAL_COUNT | missing | 21 | missing | https://observation.org/observation/226030224 | Aedes | 2D Point | PRESENT | Arthropoda | ES | Observations | 2021 | Diptera | SPECIES | missing | OBS.226030224 | Culicidae | 9 |
2 | Aedes albopictus | CC_BY_NC_4_0 | Stichting Observation International | 2022-03-24 21:21:48 | Aedes albopictus | missing | missing | 1651430 | 2021-07-22 00:00:00 | missing | c8d737e0-2ff8-42e8-b8fc-6b805d26fc5f | missing | Aedes albopictus (Skuse, 1894) | France - Pau | 25 | 2021-07-22 | missing | 1 | HUMAN_OBSERVATION | Insecta | Animalia | 8a863029-f435-446a-821e-275f4f641165 | missing | StillImage | 3723149512 | 1651430 | OCCURRENCE_STATUS_INFERRED_FROM_INDIVIDUAL_COUNT | missing | 22 | missing | https://observation.org/observation/229897504 | Aedes | 2D Point | PRESENT | Arthropoda | FR | Observations | 2021 | Diptera | SPECIES | missing | OBS.229897504 | Culicidae | 7 |
3 | Aedes albopictus | CC_BY_NC_4_0 | Stichting Observation International | 2022-03-24 21:01:03 | Aedes albopictus | missing | missing | 1651430 | 2021-08-12 00:00:00 | missing | c8d737e0-2ff8-42e8-b8fc-6b805d26fc5f | missing | Aedes albopictus (Skuse, 1894) | France - Caluire-et-Cuire | 356 | 2021-08-12 | missing | 1 | HUMAN_OBSERVATION | Insecta | Animalia | 8a863029-f435-446a-821e-275f4f641165 | missing | StillImage | 3721763202 | 1651430 | COORDINATE_ROUNDED;OCCURRENCE_STATUS_INFERRED_FROM_INDIVIDUAL_COUNT | missing | 12 | missing | https://observation.org/observation/222737616 | Aedes | 2D Point | PRESENT | Arthropoda | FR | Observations | 2021 | Diptera | SPECIES | missing | OBS.222737616 | Culicidae | 8 |
4 | Aedes albopictus | CC_BY_NC_4_0 | Stichting Observation International | 2022-03-24 20:56:46 | Aedes albopictus | missing | missing | 1651430 | 2021-07-28 00:00:00 | missing | c8d737e0-2ff8-42e8-b8fc-6b805d26fc5f | missing | Aedes albopictus (Skuse, 1894) | Spain - Elche | 4 | 2021-07-28 | missing | 1 | HUMAN_OBSERVATION | Insecta | Animalia | 8a863029-f435-446a-821e-275f4f641165 | missing | StillImage | 3721422284 | 1651430 | OCCURRENCE_STATUS_INFERRED_FROM_INDIVIDUAL_COUNT | missing | 28 | missing | https://observation.org/observation/221356176 | Aedes | 2D Point | PRESENT | Arthropoda | ES | Observations | 2021 | Diptera | SPECIES | missing | OBS.221356176 | Culicidae | 7 |
5 | Aedes albopictus (Skuse, 1894) | CC_BY_NC_4_0 | missing | 2022-03-30 14:52:49 | Aedes albopictus | missing | UIB | 1651430 | 2020-06-30 00:00:00 | (Skuse, 1894) | e37fc40e-0541-4ffa-8a4c-0426d73804e8 | missing | Aedes albopictus (Skuse, 1894) | Montesacro | missing | 2020-06-30 | missing | 10 | HUMAN_OBSERVATION | Insecta | Animalia | 03269e13-84ae-430f-990e-f11069413e36 | Introduced | missing | 3714052043 | 1651430 | COORDINATE_ROUNDED;GEODETIC_DATUM_ASSUMED_WGS84 | missing | 30 | Rm | E-Montesacro-M5-2020-06-30-1 | Aedes | 2D Point | PRESENT | Arthropoda | IT | missing | 2020 | Diptera | SPECIES | missing | missing | Culicidae | 6 |
6 | Aedes albopictus (Skuse, 1894) | CC_BY_NC_4_0 | missing | 2022-03-30 14:52:49 | Aedes albopictus | 0 | UIB | 1651430 | 2020-08-04 00:00:00 | (Skuse, 1894) | e37fc40e-0541-4ffa-8a4c-0426d73804e8 | missing | Aedes albopictus (Skuse, 1894) | 34396 | missing | 2020-08-04 | missing | 125 | HUMAN_OBSERVATION | Insecta | Animalia | 03269e13-84ae-430f-990e-f11069413e36 | Introduced | missing | 3714052039 | 1651430 | GEODETIC_DATUM_ASSUMED_WGS84 | 105 | 4 | Istanbul | E-SAR-4_200804-1 | Aedes | 2D Point | PRESENT | Arthropoda | TR | missing | 2020 | Diptera | SPECIES | missing | missing | Culicidae | 8 |
7 | Aedes albopictus (Skuse, 1894) | CC_BY_NC_4_0 | missing | 2022-03-30 14:52:49 | Aedes albopictus | 0 | UIB | 1651430 | 2020-06-12 00:00:00 | (Skuse, 1894) | e37fc40e-0541-4ffa-8a4c-0426d73804e8 | missing | Aedes albopictus (Skuse, 1894) | Zagreb | missing | 2020-06-12 | missing | 22 | HUMAN_OBSERVATION | Insecta | Animalia | 03269e13-84ae-430f-990e-f11069413e36 | Introduced | missing | 3714052027 | 1651430 | GEODETIC_DATUM_ASSUMED_WGS84 | 137 | 12 | City of Zagreb | E_CRO_ZG_40_200612-1 | Aedes | 2D Point | PRESENT | Arthropoda | HR | missing | 2020 | Diptera | SPECIES | missing | missing | Culicidae | 6 |
8 | Aedes albopictus (Skuse, 1894) | CC_BY_NC_4_0 | missing | 2022-03-30 14:52:49 | Aedes albopictus | missing | UIB | 1651430 | 2020-06-16 00:00:00 | (Skuse, 1894) | e37fc40e-0541-4ffa-8a4c-0426d73804e8 | missing | Aedes albopictus (Skuse, 1894) | Montesacro | missing | 2020-06-16 | missing | 3 | HUMAN_OBSERVATION | Insecta | Animalia | 03269e13-84ae-430f-990e-f11069413e36 | Introduced | missing | 3714052010 | 1651430 | COORDINATE_ROUNDED;GEODETIC_DATUM_ASSUMED_WGS84 | missing | 16 | Rm | E-Montesacro-M1-2020-06-16-1 | Aedes | 2D Point | PRESENT | Arthropoda | IT | missing | 2020 | Diptera | SPECIES | missing | missing | Culicidae | 6 |
9 | Aedes albopictus (Skuse, 1894) | CC_BY_NC_4_0 | missing | 2022-03-30 14:52:49 | Aedes albopictus | 0 | UIB | 1651430 | 2020-09-02 00:00:00 | (Skuse, 1894) | e37fc40e-0541-4ffa-8a4c-0426d73804e8 | missing | Aedes albopictus (Skuse, 1894) | Terrassa | missing | 2020-09-02 | missing | 2 | HUMAN_OBSERVATION | Insecta | Animalia | 03269e13-84ae-430f-990e-f11069413e36 | Introduced | missing | 3714052007 | 1651430 | GEODETIC_DATUM_ASSUMED_WGS84 | 220 | 2 | Barcelona | E_SP_LesFonts_4_200902-1 | Aedes | 2D Point | PRESENT | Arthropoda | ES | missing | 2020 | Diptera | SPECIES | missing | missing | Culicidae | 9 |
10 | Aedes albopictus (Skuse, 1894) | CC_BY_NC_4_0 | missing | 2022-03-30 14:52:49 | Aedes albopictus | 0 | UIB | 1651430 | 2020-11-25 00:00:00 | (Skuse, 1894) | e37fc40e-0541-4ffa-8a4c-0426d73804e8 | missing | Aedes albopictus (Skuse, 1894) | Sarande | missing | 2020-11-25 | missing | 2 | HUMAN_OBSERVATION | Insecta | Animalia | 03269e13-84ae-430f-990e-f11069413e36 | Introduced | missing | 3714052005 | 1651430 | GEODETIC_DATUM_ASSUMED_WGS84 | 22 | 25 | Sarande | E_AL_SR_3_201125-1 | Aedes | 2D Point | PRESENT | Arthropoda | AL | missing | 2020 | Diptera | SPECIES | missing | missing | Culicidae | 11 |
11 | Aedes albopictus (Skuse, 1894) | CC_BY_NC_4_0 | missing | 2022-03-30 14:52:49 | Aedes albopictus | missing | UIB | 1651430 | 2020-10-20 00:00:00 | (Skuse, 1894) | e37fc40e-0541-4ffa-8a4c-0426d73804e8 | missing | Aedes albopictus (Skuse, 1894) | Monterotondo | missing | 2020-10-20 | missing | 1 | HUMAN_OBSERVATION | Insecta | Animalia | 03269e13-84ae-430f-990e-f11069413e36 | Introduced | missing | 3714052000 | 1651430 | GEODETIC_DATUM_ASSUMED_WGS84 | missing | 20 | Rm | E-Monterotondo-C4-2020-10-20-1 | Aedes | 2D Point | PRESENT | Arthropoda | IT | missing | 2020 | Diptera | SPECIES | missing | missing | Culicidae | 10 |
12 | Aedes albopictus (Skuse, 1894) | CC_BY_NC_4_0 | missing | 2022-03-30 14:52:49 | Aedes albopictus | 0 | UIB | 1651430 | 2020-09-10 00:00:00 | (Skuse, 1894) | e37fc40e-0541-4ffa-8a4c-0426d73804e8 | missing | Aedes albopictus (Skuse, 1894) | Palma | missing | 2020-09-10 | missing | 11 | HUMAN_OBSERVATION | Insecta | Animalia | 03269e13-84ae-430f-990e-f11069413e36 | Introduced | missing | 3714051997 | 1651430 | COORDINATE_ROUNDED;GEODETIC_DATUM_ASSUMED_WGS84 | 20 | 10 | Mallorca | A-SP-Palma-3-1-200910-1 | Aedes | 2D Point | PRESENT | Arthropoda | ES | missing | 2020 | Diptera | SPECIES | missing | missing | Culicidae | 9 |
13 | Aedes albopictus (Skuse, 1894) | CC_BY_NC_4_0 | missing | 2022-03-30 14:52:49 | Aedes albopictus | 0 | UIB | 1651430 | 2020-07-21 00:00:00 | (Skuse, 1894) | e37fc40e-0541-4ffa-8a4c-0426d73804e8 | missing | Aedes albopictus (Skuse, 1894) | Etxebarri | missing | 2020-07-21 | missing | 15 | HUMAN_OBSERVATION | Insecta | Animalia | 03269e13-84ae-430f-990e-f11069413e36 | Introduced | missing | 3714051996 | 1651430 | GEODETIC_DATUM_ASSUMED_WGS84 | 27.1 | 21 | Bizkaia | E_ETX-FU-02_200721-1 | Aedes | 2D Point | PRESENT | Arthropoda | ES | missing | 2020 | Diptera | SPECIES | missing | missing | Culicidae | 7 |
⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ |
13892 | Aedes albopictus | CC0_1_0 | missing | 2022-01-30 11:39:38 | Aedes albopictus | missing | missing | 1651430 | 2011-01-01 00:00:00 | missing | 92f51af1-e917-49bc-a8ed-014ed3a77bec | missing | Aedes albopictus (Skuse, 1894) | missing | missing | 2011-01-01 | missing | 1 | MATERIAL_CITATION | Insecta | Animalia | 33614778-513a-4ec0-814d-125021cca5fe | missing | missing | 1264853939 | 1651430 | GEODETIC_DATUM_ASSUMED_WGS84;OCCURRENCE_STATUS_UNPARSABLE | missing | missing | missing | 4461 | Aedes | 2D Point | PRESENT | Arthropoda | TR | missing | 2011 | Diptera | SPECIES | missing | missing | Culicidae | missing |
13893 | Aedes albopictus | CC0_1_0 | missing | 2022-01-30 11:39:38 | Aedes albopictus | missing | missing | 1651430 | 2010-01-01 00:00:00 | missing | 92f51af1-e917-49bc-a8ed-014ed3a77bec | missing | Aedes albopictus (Skuse, 1894) | missing | missing | 2010-01-01 | missing | 1 | MATERIAL_CITATION | Insecta | Animalia | 33614778-513a-4ec0-814d-125021cca5fe | missing | missing | 1264853888 | 1651430 | GEODETIC_DATUM_ASSUMED_WGS84;OCCURRENCE_STATUS_UNPARSABLE | missing | missing | missing | 4460 | Aedes | 2D Point | PRESENT | Arthropoda | ME | missing | 2010 | Diptera | SPECIES | missing | missing | Culicidae | missing |
13894 | Aedes albopictus | CC_BY_NC_4_0 | filippoceccolini | 2022-04-05 23:28:48 | Aedes albopictus | missing | iNaturalist | 1651430 | 2007-09-29 00:00:00 | missing | 28eb1a3f-1c15-4a95-931a-4af90ecb574d | 2016-01-01 20:22:56 | Aedes albopictus (Skuse, 1894) | missing | 7 | 2007-09-29 | filippoceccolini | 1 | HUMAN_OBSERVATION | Insecta | Animalia | 50c9509d-22c7-4a22-a47d-8c48425ef4a7 | missing | StillImage | 1227767147 | 1651430 | missing | missing | 29 | Toscana | http://www.inaturalist.org/observations/2533926 | Aedes | 2D Point | PRESENT | Arthropoda | IT | Observations | 2007 | Diptera | SPECIES | filippoceccolini | 2533926 | Culicidae | 9 |
13895 | Aedes albopictus | CC_BY_NC_4_0 | Sergio | 2022-04-05 22:57:01 | Aedes albopictus | missing | iNaturalist | 1651430 | 2015-08-22 06:27:57 | missing | 28eb1a3f-1c15-4a95-931a-4af90ecb574d | 2015-08-28 21:54:44 | Aedes albopictus (Skuse, 1894) | missing | 25 | 2015-08-22 | Eduardo Martínez | 1 | HUMAN_OBSERVATION | Insecta | Animalia | 50c9509d-22c7-4a22-a47d-8c48425ef4a7 | missing | StillImage | 1143523754 | 1651430 | COORDINATE_ROUNDED | missing | 22 | Cataluña | http://www.inaturalist.org/observations/1881457 | Aedes | 2D Point | PRESENT | Arthropoda | ES | Observations | 2015 | Diptera | SPECIES | Sergio | 1881457 | Culicidae | 8 |
13896 | Aedes albopictus | CC_BY_4_0 | Marcello Consolo | 2022-04-05 23:26:50 | Aedes albopictus | missing | iNaturalist | 1651430 | 2014-09-30 16:57:39 | missing | 28eb1a3f-1c15-4a95-931a-4af90ecb574d | 2014-10-02 11:47:31 | Aedes albopictus (Skuse, 1894) | missing | missing | 2014-09-30 | Marcello Consolo | 1 | HUMAN_OBSERVATION | Insecta | Animalia | 50c9509d-22c7-4a22-a47d-8c48425ef4a7 | missing | StillImage | 1024333328 | 1651430 | missing | missing | 30 | Veneto | http://www.inaturalist.org/observations/905732 | Aedes | 2D Point | PRESENT | Arthropoda | IT | Observations | 2014 | Diptera | SPECIES | Marcello Consolo | 905732 | Culicidae | 9 |
13897 | Aedes albopictus | CC_BY_NC_4_0 | molluria | 2022-04-05 22:56:54 | Aedes albopictus | missing | iNaturalist | 1651430 | 2014-09-08 21:27:32 | missing | 28eb1a3f-1c15-4a95-931a-4af90ecb574d | 2014-09-08 19:28:30 | Aedes albopictus (Skuse, 1894) | missing | 500 | 2014-09-08 | molluria | 1 | HUMAN_OBSERVATION | Insecta | Animalia | 50c9509d-22c7-4a22-a47d-8c48425ef4a7 | missing | StillImage | 1024223371 | 1651430 | missing | missing | 8 | Cataluña | http://www.inaturalist.org/observations/867653 | Aedes | 2D Point | PRESENT | Arthropoda | ES | Observations | 2014 | Diptera | SPECIES | molluria | 867653 | Culicidae | 9 |
13898 | Aedes albopictus | CC_BY_4_0 | Marcello Consolo | 2022-04-05 23:20:48 | Aedes albopictus | missing | iNaturalist | 1651430 | 2014-09-01 16:02:18 | missing | 28eb1a3f-1c15-4a95-931a-4af90ecb574d | 2014-09-01 21:17:57 | Aedes albopictus (Skuse, 1894) | missing | missing | 2014-09-01 | Marcello Consolo | 1 | HUMAN_OBSERVATION | Insecta | Animalia | 50c9509d-22c7-4a22-a47d-8c48425ef4a7 | missing | StillImage | 1024219620 | 1651430 | missing | missing | 1 | Veneto | http://www.inaturalist.org/observations/857721 | Aedes | 2D Point | PRESENT | Arthropoda | IT | Observations | 2014 | Diptera | SPECIES | Marcello Consolo | 857721 | Culicidae | 9 |
13899 | Aedes albopictus | CC_BY_4_0 | missing | 2022-02-24 22:31:39 | Aedes albopictus | missing | naturgucker | 1651430 | 2012-06-16 00:00:00 | missing | bb646dff-a905-4403-a49b-6d378c2cf0d9 | missing | Aedes albopictus (Skuse, 1894) | Bischweier | 250 | 2012-06-16 | missing | 1 | HUMAN_OBSERVATION | Insecta | Animalia | 6ac3f774-d9fb-4796-b3e9-92bf6c81c084 | missing | missing | 920240316 | 1651430 | COORDINATE_ROUNDED;GEODETIC_DATUM_ASSUMED_WGS84 | missing | 16 | missing | missing | Aedes | 2D Point | PRESENT | Arthropoda | DE | naturgucker | 2012 | Diptera | SPECIES | -430290170 | 481639899 | Culicidae | 6 |
13900 | Aedes albopictus | CC_BY_4_0 | missing | 2022-02-24 22:32:57 | Aedes albopictus | missing | naturgucker | 1651430 | 2007-05-12 00:00:00 | missing | bb646dff-a905-4403-a49b-6d378c2cf0d9 | missing | Aedes albopictus (Skuse, 1894) | Bischweier | 250 | 2007-05-12 | missing | 1 | HUMAN_OBSERVATION | Insecta | Animalia | 6ac3f774-d9fb-4796-b3e9-92bf6c81c084 | missing | missing | 920235626 | 1651430 | COORDINATE_ROUNDED;GEODETIC_DATUM_ASSUMED_WGS84 | missing | 12 | missing | missing | Aedes | 2D Point | PRESENT | Arthropoda | DE | naturgucker | 2007 | Diptera | SPECIES | -430290170 | -470102427 | Culicidae | 5 |
13901 | Aedes albopictus | CC_BY_4_0 | Marcello Consolo | 2022-04-05 23:27:15 | Aedes albopictus | missing | iNaturalist | 1651430 | 2012-09-23 00:43:47 | missing | 28eb1a3f-1c15-4a95-931a-4af90ecb574d | 2013-05-07 15:46:38 | Aedes albopictus (Skuse, 1894) | missing | missing | 2012-09-23 | Marcello Consolo | 1 | HUMAN_OBSERVATION | Insecta | Animalia | 50c9509d-22c7-4a22-a47d-8c48425ef4a7 | missing | missing | 891148847 | 1651430 | missing | missing | 23 | Veneto | http://www.inaturalist.org/observations/258032 | Aedes | 2D Point | PRESENT | Arthropoda | IT | Observations | 2012 | Diptera | SPECIES | Marcello Consolo | 258032 | Culicidae | 9 |
13902 | Aedes albopictus | CC_BY_4_0 | Marcello Consolo | 2022-04-05 22:56:55 | Aedes albopictus | missing | iNaturalist | 1651430 | 2013-10-18 17:39:28 | missing | 28eb1a3f-1c15-4a95-931a-4af90ecb574d | 2013-10-27 21:08:54 | Aedes albopictus (Skuse, 1894) | missing | 1 | 2013-10-18 | Marcello Consolo | 1 | HUMAN_OBSERVATION | Insecta | Animalia | 50c9509d-22c7-4a22-a47d-8c48425ef4a7 | missing | StillImage | 891028988 | 1651430 | missing | missing | 18 | Veneto | http://www.inaturalist.org/observations/441906 | Aedes | 2D Point | PRESENT | Arthropoda | IT | Observations | 2013 | Diptera | SPECIES | Marcello Consolo | 441906 | Culicidae | 10 |
13903 | Aedes (Stegomyia) albopictus | CC_BY_4_0 | missing | 2022-02-28 13:59:54 | Aedes albopictus | missing | MCNB | 1651430 | 2010-08-20 00:00:00 | missing | e8eada63-4a33-44aa-b2fd-4f71efb222a0 | 2010-08-21 00:00:00 | Aedes albopictus (Skuse, 1894) | missing | 8633.08 | 2010-08-20 | Mederos López, Jorge Luis | 1 | PRESERVED_SPECIMEN | Insecta | Animalia | 7a498826-f762-11e1-a439-00145eb45e9a | missing | missing | 768646453 | 1651430 | OCCURRENCE_STATUS_INFERRED_FROM_INDIVIDUAL_COUNT;COLLECTION_MATCH_NONE;INSTITUTION_MATCH_FUZZY | 280 | 20 | Barcelona | MCNB:MCNB-Art:MZB 2010-1153 | Aedes | 2D Point | PRESENT | Arthropoda | ES | MCNB-Art | 2010 | Diptera | SPECIES | Mederos López, Jorge Luis | MZB 2010-1153 | Culicidae | 8 |
GeoInterface¶
It might be unclear one can do with all these different types of tables and geometries. Many packages define their own Point like objects, and at first sight, that might make combining packages difficult.
geodataf_geom = df.geom[1]
Geometry: POINT (3.206186 41.977133)
?geodataf_geom
search: geodataf_geom
Similarly, we have the Point from the GeoJSON we read earlier.
geojson_geom = first(fcg);
?geojson_geom
search: geojson_geom
No documentation found.
geojson_geom
is of type GeoJSON.Point{2, Float32}
.
Summary¶
struct GeoJSON.Point{2, Float32}
Fields¶
bbox :: Union{Nothing, Vector{Float32}}
coordinates :: Union{Nothing, Tuple{Float32, Float32}}
Supertype Hierarchy¶
GeoJSON.Point{2, Float32} <: GeoJSON.AbstractGeometry{2, Float32} <: GeoJSON.GeoJSONT{2, Float32} <: Any
Pkg.add("Tables")
using Tables
Resolving package versions... No Changes to `~/code/Project.toml` No Changes to `~/code/Manifest.toml`
Interfaces¶
While not originally designed in base Julia, multiple dispatch has lead to the implementation of traits. That is, a property of type that we can dispatch on. In such a way, we can build interfaces for common objects in Julia. The most implemented is probably either the Array interface, or the Tables interface.
Tables.jl defines several functions that one has to implement on their own table-like type. These include the basic istable
(by default false
for anything), which if it returns true
for a type, one expects that columns
also works on it.
Tables.istable(df)
true
Tables.columns(df)[1] # first column of the DataFrame (from DataFrames.jl).
13903-element Vector{ArchGDAL.IGeometry{ArchGDAL.wkbPoint}}: Geometry: POINT (3.206186 41.977133) Geometry: POINT (-0.349167 43.306944) Geometry: POINT (4.863264 45.796704) Geometry: POINT (-0.647022 38.130955) Geometry: POINT (12.725833 42.136389) Geometry: POINT (29.039686 41.233929) Geometry: POINT (15.88896 45.81166) Geometry: POINT (12.731667 42.150556) Geometry: POINT (2.04 41.525) Geometry: POINT (20.000187 39.873289) Geometry: POINT (12.818611 42.131944) Geometry: POINT (2.620506 39.546583) Geometry: POINT (-2.895006 43.247069) ⋮ Geometry: POINT (26.53 41.3) Geometry: POINT (19.4 42.7) Geometry: POINT (11.262063 43.778973) Geometry: POINT (2.759273 41.693739) Geometry: POINT (11.939499 45.39915) Geometry: POINT (1.72644 41.22143) Geometry: POINT (11.939499 45.39915) Geometry: POINT (8.273545 48.842892) Geometry: POINT (8.273545 48.842892) Geometry: POINT (11.939381 45.399271) Geometry: POINT (11.939481 45.399232) Geometry: POINT (2.1529 41.3937)
Similarly, other I/O packages can just accept your table and try to write it:
Pkg.add("CSV")
using CSV
CSV.write("test.csv", df)
readlines("test.csv")[2] # geometry was converted by string, which is probably not what you want
Resolving package versions... No Changes to `~/code/Project.toml` No Changes to `~/code/Manifest.toml`
"Geometry: POINT (3.206186 41.977133),3.723517781e9,8a863029-f435-446a-821e-275f4f641165,https://observation.org/observation/226030224,Animalia,Arthropoda,Insecta,Diptera,Culicidae,Aedes,Aedes albopictus,,SPECIES,\"Aedes albopictus (Skuse, 1894)\",Aedes albopictus,,ES,Spain" ⋯ 45 bytes ⋯ "-6b805d26fc5f,43.0,,,,,,2021-09-21 00:00:00,21.0,9.0,2021.0,1.65143e6,1.65143e6,HUMAN_OBSERVATION,,Observations,OBS.226030224,,,,CC_BY_NC_4_0,Stichting Observation International,,,,2022-03-24 21:07:39,StillImage,OCCURRENCE_STATUS_INFERRED_FROM_INDIVIDUAL_COUNT,2021-09-21"
The GeoInterface.jl package describe a set of traits based on the Simple Features standard (SF) for geospatial vector data, including the SQL/MM extension with support for circular geometry. Using these traits, it should be easy to parse, serialize and use different geometries in the Julia ecosystem, without knowing the specifics of each individual package. In that regard it is similar to Tables.jl, but for geometries instead of tables.
using GeoInterface
GeoInterface.isgeometry(geodataf_geom) # from the geopackage, based on ArchGDAL
true
GeoInterface.isgeometry(geojson_geom) # from GeoJSON
true
GeoInterface.geomtrait(geodataf_geom)
PointTrait()
GeoInterface.ncoord(geodataf_geom)
2
GeoInterface.coordinates(geodataf_geom)
2-element Vector{Float64}: 3.206186 41.977133
GeoInterface.coordinates(geojson_geom)
(3.206186f0, 41.977135f0)
With the above interface, we can reconstruct geometries as other types. Packages that implement convert
make this easy, as I also don't know how to construct a custom Point like type in ArchGDAL (createpoint
).
cg = GeoInterface.convert(ArchGDAL, geojson_geom) # convert GeoJSON point to ArchGDAL point
Geometry: POINT (3.20618605613708 41.9771347045898)
typeof(cg)
ArchGDAL.IGeometry{ArchGDAL.wkbPoint}