Skip to content
This repository has been archived by the owner on May 11, 2024. It is now read-only.

ualsg/GANmapper

Repository files navigation

Logo

GANmapper - Geospatial Content Filling

Logo

This is the official repo of GANmapper, a building footprint generator using Generative Adversarial Networks

Running GANmapper

1. Install prerequisites

Use environment.yml to create a conda environment for GANmapper

conda env create -f environment.yml
conda activate GANmapper

2. Download weights

The weights files are available on figshare in the Checkpoints folder.

https://doi.org/10.6084/m9.figshare.15103128.v1

Place the Checkpoints folder in the repo.

3. Prediction

Predictions can be carried out by running the following sample code. The name of the city depends on the name of each dataset.

python predict.py --dataroot <path to XYZ tile dir> --checkpoints_dir <path to checkpoint> --name <cityname> 

Testing an area in LA:

python predict.py --dataroot datasets/Exp4/LA/Source --checkpoints_dir checkpoints/Exp3 --name LA 

Testing an area in Singapore:

python predict.py --dataroot datasets/Exp4/Singapore/Source --checkpoints_dir checkpoints/Exp3 --name Singapore 

The result will be produced in XYZ directories in ./results/<cityname>/test_latest/images/fake

You can choose to visualise the tiles in QGIS using a local WMTS server.

For example, use the following url and choose Zomm 16 only.

file:///D:/GANmapper//results/Singapore/test_latest/images/fake/{z}/{x}/{y}.png

4. Vectorization

If you want the output to be in Geojson polygons, use extract.py

  python extract.py <tile_dir>  <out> 
  python extract.py results/Exp4/LA/test_latest/images/fake LA.geojson

License

Distributed under the MIT License. See LICENSE for more information.

Citation

A paper about the work was published in International Journal of Geographical Information Science, and it is available open access here.

If you like this work and would like to use it in a scientific context, please cite this article.

Wu AN, Biljecki F (2022): GANmapper: geographical data translation. International Journal of Geographical Information Science, 36(7): 1394-1422. doi:10.1080/13658816.2022.2041643

@article{2022_ijgis_ganmapper,
 author = {Wu, Abraham Noah and Biljecki, Filip},
 doi = {10.1080/13658816.2022.2041643},
 journal = {International Journal of Geographical Information Science},
 title = {{GANmapper: geographical data translation}},
 volume = {36},
 issue = {7},
 pages = {1394-1422},
 year = {2022}
}

Contact

Abraham Noah Wu, Urban Analytics Lab, National University of Singapore, Singapore

Acknowledgements

This research is part of the project Large-scale 3D Geospatial Data for Urban Analytics, which is supported by the National University of Singapore under the Start-Up Grant R-295-000-171-133.

We gratefully acknowledge the sources of the used input data.

GANmapper is made possible by using the following packages

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages