README.md 4.54 KB
Newer Older
1
2
# RegionChooser

Eric Duminil's avatar
Eric Duminil committed
3
[RegionChooser](https://transfer.hft-stuttgart.de/gitlab/hft_gitlab/regionchooser) is a Java project. Its graphical interface allows to extract a specific region from multiple [CityGML](https://www.ogc.org/standards/citygml) files and save it as a smaller CityGML file.
4

Eric Duminil's avatar
Eric Duminil committed
5
6
![RegionChooserScreenshot](region_chooser_screenshot.png)

7
8
It uses:

Eric Duminil's avatar
Eric Duminil committed
9
* [Java 8](https://simstadt.hft-stuttgart.de/getting-started/install-software/#java-8)
Eric Duminil's avatar
Eric Duminil committed
10
* JavaFX
Eric Duminil's avatar
Eric Duminil committed
11
* [Openlayers](https://openlayers.org/)
12

Eric Duminil's avatar
Eric Duminil committed
13
RegionChooser was developed during [SimStadt & SimStadt II](https://www.hft-stuttgart.de/forschung/projekte/aktuell/simstadt-20)  projects.
Eric Duminil's avatar
Eric Duminil committed
14

15
16
## Installation

Eric Duminil's avatar
Eric Duminil committed
17
The easiest way to install RegionChooser is to [install SimStadt](https://simstadt.hft-stuttgart.de/getting-started/install-software/#simstadt).
Eric Duminil's avatar
Eric Duminil committed
18
19

RegionChooser executables are packaged inside SimStadt.zip file.
20
21
22

## Usage

Eric Duminil's avatar
Eric Duminil committed
23
24
### Select a repository

Eric Duminil's avatar
Eric Duminil committed
25
You first need to run SimStadt in order to select a [repository](https://simstadt.hft-stuttgart.de/getting-started/repository-structure/#repository). Once a repository is selected, SimStadt can be closed.
Eric Duminil's avatar
Eric Duminil committed
26
27
28
29
30
31
32

### Start RegionChooser

* `RegionChooser.bat` in Windows
* `./RegionChooser.sh` in Linux
* `./RegionChooser.command` in macOS

Eric Duminil's avatar
Eric Duminil committed
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
### Select a region

* Once a repository has been imported, a map should be shown with the convex hulls of the available CityGML files.
* It is possible to define a polygon by clicking repeatedly on the map.
* If an intersection is found with at least one CityGML file, a list of files will be shown on the right.
* The selection might intersect multiple files. The user can select the desired files.
* By clicking on `Download Region`, a new CityGML file will be created, by merging the intersections of the polygon with each selected CityGML file.

### Get coordinates of polygon

The coordinates of the currently drawn polygon can be exported to [WKT](https://en.wikipedia.org/wiki/Well-known_text_representation_of_geometry) by clicking on `Copy coordinates`. It can be useful for further processing, e.g. in a Python script.

As an example:

> POLYGON((9.176194 48.779168, 9.171473 48.775265, 9.176923 48.772890, 9.179842 48.774474, 9.181043 48.774134, 9.183103 48.775661, 9.182073 48.776962, 9.176194 48.779168))

Eric Duminil's avatar
Eric Duminil committed
49
50
51
52
53
54
### Import a polygon

If no polygon has been drawn yet, "WKT Polygon" input field can be used. Simply copy a [WKT](https://en.wikipedia.org/wiki/Well-known_text_representation_of_geometry) polygon into the field, click on `Import Polygon`, and the geometry should be imported into RegionChooser.

With this feature, it should be easy to share geometry between users.

Eric Duminil's avatar
Eric Duminil committed
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
## Command-line

RegionChooser can also be called from the command-line:

```bash
Launching RegionChooser CLI --help
Usage: region_chooser [-hlV] [-e=31467] -o=output.gml -w=polygon.wkt -i=input.
                      gml[,input.gml...] [-i=input.gml[,input.gml...]]...
Extracts a region from one or more citygmls.
  -i, --input=input.gml[,input.gml...]
                            Citygml files to extract from
  -o, --output=output.gml   Output file
  -e, --epsg=31467          EPSG id for coordinate reference system.
                            Will use the one from input.gml if unspecified.
  -l, --local               Are WKT coordinates in local CRS?
                            Coordinates are in WGS84 if unspecified.
  -w, --wkt=polygon.wkt     File containing WKT polygon, or - for stdin
  -h, --help                Show this help message and exit.
  -V, --version             Print version information and exit.
```

As an example:

```bash
java -classpath "Desktop\SimStadt_0.10.0-SNAPSHOT_master_20221019_7d2546f\lib\*"
     eu.simstadt.regionchooser.RegionChooserCLI
	 --input Grombühl.proj\LoD2_32_566_5516_2_BY.gml,Grombühl.proj\LoD2_32_568_5516_2_BY.gml,Grombühl.proj\LoD2_32_570_5516_2_BY.gml
	 --output Grombühl.proj\Grombühl.gml --wkt "POLYGON((9.920858224863567 49.807325539080495, 9.918540796274696 49.79447295986074, 9.992612680429975 49.79358644932381, 9.991926034922162 49.807325539080495, 9.920858224863567 49.807325539080495))"
```

Eric Duminil's avatar
Eric Duminil committed
85
86
87
88
89
90
91
92
93
94
95
## Development

In order to compile, test and install RegionChooser into your local Maven repository:

```bash
git clone https://transfer.hft-stuttgart.de/gitlab/hft_gitlab/regionchooser.git
cd regionchooser
mvn clean install
```

The RegionChooser jar will then be available to SimStadt for packaging, when a SimStadt+RegionChooser bundle is created.
96
97
98

## Author

Eric Duminil's avatar
Eric Duminil committed
99
Eric Duminil, [HfT Stuttgart](https://www.hft-stuttgart.de/)
100
101
102

## Contributors

Eric Duminil's avatar
Eric Duminil committed
103
Matthias Betz, [HfT Stuttgart](https://www.hft-stuttgart.de/)
104
105

## License
Eric Duminil's avatar
Eric Duminil committed
106
[MIT](https://choosealicense.com/licenses/mit/)