diff options
author | Guilhem Moulin <guilhem@fripost.org> | 2023-09-28 17:25:43 +0200 |
---|---|---|
committer | Guilhem Moulin <guilhem@fripost.org> | 2023-09-28 17:25:43 +0200 |
commit | 83c0d52908b2dc8ffab11e42688300cd523b08ac (patch) | |
tree | d1e94d5d7a35b62971e655f586df5e14843791ab | |
parent | 15bd25f7acf1bf97bffad9144d2c5a6c6dde5239 (diff) |
--point: Take northing,easting rather than the opposite (traditional GIS format).
Both Lantmäteriet and QGIS follow this convention, so it makes it easier
to copy coordinates this way.
-rwxr-xr-x | gis-observation-map | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gis-observation-map b/gis-observation-map index 5821652..8153c9f 100755 --- a/gis-observation-map +++ b/gis-observation-map @@ -78,8 +78,8 @@ class geometryAction(argparse.Action): parser = argparse.ArgumentParser( description='Create a QGIS project with observations from Artdatabanken.', prog = programName, - usage='''%(prog)s --project-home=DIR --project-name=NAME {--geometry=FILE|--point=X,Y} ... - %(prog)s --observation-file=NAME {--geometry=FILE|--point=X,Y} ...''' + usage='''%(prog)s --project-home=DIR --project-name=NAME {--geometry=FILE|--point=Y,X} ... + %(prog)s --observation-file=NAME {--geometry=FILE|--point=Y,X} ...''' ) parser.add_argument('--project-home', type=ePath, metavar='DIRECTORY', help='Project home directory') @@ -92,7 +92,7 @@ parser_geom.add_argument('--geometry-style', type=ePath, dest='geometry_style', help='QGIS Layer Style File (*.qml) to apply to subsequent geometry files') parser_geom.add_argument('--geometry', nargs='*', default=[], type=ePath, metavar='GEOMETRY_FILE', action=geometryAction, help='Geometry file of interest') -parser_geom.add_argument('--point', nargs='*', metavar='X,Y', default=[], +parser_geom.add_argument('--point', nargs='*', metavar='Y,X', default=[], help=f'Coordinates of interest (in {target_srs.GetName()})') parser_geom.add_argument('--margin', metavar='N', type=int, help='Margin (in meters) around geometry envelopes') @@ -276,7 +276,7 @@ def find_qlr(basedir): geometries = [] for pt in args.point: - x, y = pt.split(',', 1) + y, x = pt.split(',', 1) x = int(x) y = int(y) |