Skip to content

Commit

Permalink
document the differ
Browse files Browse the repository at this point in the history
  • Loading branch information
smnorris committed Sep 12, 2024
1 parent c137853 commit 0773c75
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/fit_changedetector/diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,25 @@


def differ(source_file_a, source_file_b, primary_key, fields=None, precision=2):
"""
Compare two spatial datasets.
Source files MUST:
- be readable by ogr
- have valid, compatible primary keys
- have at least one equivalent column (ok if this is just the primary key)
- equivalent column names must be of equivalent types
- have geometries stored in a "geometry" column
- have equivalent geometry types and coordinate reference systems
Output is five dataframes
- additions
- deletions
- modifications - geometry only
- modifications - attribute only
- modifications - geometry and attribute
The attribute change dataframes include values from both sources.
"""
df_a = geopandas.read_file(source_file_a)
df_b = geopandas.read_file(source_file_b)

Expand Down

0 comments on commit 0773c75

Please sign in to comment.