How to Flip Transects
Available Scripts:¶
1.transects_swap_points.py
- A script that reads a
config_gdf.geojson
and swaps the origin & end point for each transect. - The new transects (default name :
reversed_transects.geojson
) are saved to the scripts directory
2.shorten_transects.py
- A script that reads a geojson file containing transects and can shorten or length each transect depending on the parameters used
- The new transects (default name :
shortened_transects.geojson
) are saved to the scripts directory
Prerequisites for running the script¶
1. Open Anaconda Prompt
- Navigate to the Start menu or application directory and open the Anaconda Prompt.
2. Navigate to the Scripts Directory
- Replace path_to_your_directory with the location where the coastseg directory is located on your machine.
1 2 |
|
Run the Script transects_swap_points.py¶
- This will swap each transect's origin and end point
1 |
|
1. Example: Use config_gdf.geojson To run the script named transects_swap_points.py, you can execute:
1 |
|
2. Example: Use transects.geojson
1 |
|
Run the Script shorten_transects.py¶
Example 1: Shorten the transects by 500m
-s
shorten the length of the transect by 500 meters by moving the origin seaward
1 |
|
Example 2: Shorten the transects by 500m from the origin and lengthen by 100m from the seaward point
-
-s
shorten the length of the transect by 500 meters by moving the origin towards the end point -
-l
lengthen the length of the transect by 100 meters by moving the end point more seaward
1 |
|
Example 3: Shorten the transects by 500m from the origin and lengthen by 100m from the seaward point and save to shortened_transects2.geojson
-
-s
shorten the length of the transect by 500 meters by moving the origin towards the end point -
-l
lengthen the length of the transect by 100 meters by moving the end point more seaward -
-o
save the new transects to file "shortened_transects2.geojson"
1 |
|
Getting Help¶
For most scripts, you can get a description of the available options and how to use them by using the -h or --help flag:
1 |
|
Or:
1 |
|
You can also open the script in any text editor or IDE like Notepad++, VSCode, or similar to view the documentation.