Skip to content

Commit

Permalink
add docs about geometrycolumns and crs for feature collections
Browse files Browse the repository at this point in the history
  • Loading branch information
asinghvi17 committed Nov 24, 2024
1 parent 9b71b4b commit b1a94d6
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions docs/src/guides/developer.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,22 @@ GeoInterface.geometrycolumns(::customcollection) = (:geometry,) # can be multip

The `geometrycolumns` enables other packages to know which field in a row, or column in a table, contains the geometry or geometries.

It's important to note that the `geometrycolumns` should always return a `Tuple` of `Symbol`s. However, it does have a fallback method
that uses [DataAPI.jl](https://github.com/JuliaData/DataAPI.jl) metadata, if it exists, to retrieve the geometry columns. This relies on
the `GEOINTERFACE:geometrycolumns` metadata key. GeoInterface.jl compatible writers may set this metadata key if writing to a format
that does not have its own mechanism to store known geometry columns, like Arrow.

Optionally, the `crs` method can also be implemented:
```julia
GeoInterface.crs(::customcollection)
```

This should return a `GeoFormatTypes.CoordinateReferenceSystem` type, such as `EPSG(code::Int)`, `WellKnownText(GeoFormatTypes.CRS(), wkt::String)`,
or `ProjString(p4::String)`. See [GeoFormatTypes.jl](https://github.com/JuliaGeo/GeoFormatTypes.jl) for more information.

The `crs` method also has a fallback that uses [DataAPI.jl](https://github.com/JuliaData/DataAPI.jl) metadata, if it exists, to retrieve the CRS.
GeoInterface searches for the `GEOINTERFACE:crs` metadata key to retrieve the CRS.

## Geospatial Operations
```julia
distance(geomtrait(a), geomtrait(b), a, b)
Expand Down

0 comments on commit b1a94d6

Please sign in to comment.