Python command line application to convert BrokJSON files to GeoJSON files and vice versa
What is BrokJSON?
Minimal required Python version: 3.4
- Execute the following command in the command line
pip install git+https://github.com/Kasluk24/brokjson-file-converter.git#egg=brokjson-file-converter
- Download the zip file from GitHub and save it in a directory of your choice
- Install from the zip file with the following command (replace <brokjson-file-converter.zip> with the path to the downloaded file)
pip install <brokjson-file-converter.zip>
- Download the zip file from GitHub and save it in a directory of your choice
- Navigate to the file main.py
- Open the console and run with
python __main__.py <function> <inpath> <outpath>
- The converter can convert BrokJSON files to GeoJSON files and also GeoJSON files to BrokJSON files. The first argument defines the direction.
geo2brok = from GeoJSON to BrokJSON, brok2geo = BrokJSON to GeoJSON
- The second argument defines the file to be converted
- The third argument is optional and specifies the converted file. If this file is not specified, the converter creates a subfolder (geo2brok or brok2geo depending on the selected direction) and saves the converted file with the original filename in it
- To convert all files in a directory with the ending "*.json", just specifie the directory instead of the filename
- If no export directory is specified, the files are written to a subfolder named "geojson" or "brokjson" depending on the output format
- By default, the converter creates a new folder if no export directory or file has been specified and keeps the original files
- With the flag "-o" or "--overwrite" the original files are overwritten, even if no export directory / file is specified
- If an export directory or file has been specified, existing files in the directory are overwritten if they have the same name
- Convert the GeoJSON file "GeoJSON.json" to the BrokJSON file BrokJSON.json
python -m brokjson-file-converter geo2brok GeoJSON.json BrokJSON.json
- Convert the brokJSON file "BrokJSON.json" to the GeoJSON file GeoJSON.json
python -m brokjson-file-converter brok2geo BrokJSON.json GeoJSON.json
- Convert all "*.json" files inside the directory "brokfiles" to GeoJSON files into the directory "geofiles"
python -m brokjson-file-converter brok2geo brokfiles geofiles
- Convert all "*.json" files inside the directory "geofiles" to BrokJSON files and overwrite the original files
python -m brokjson-file-converter -o geo2brok geofiles