summer_course_2024/WINDOWS_INSTALL.md
2022-04-12 09:42:43 -04:00

2.7 KiB

Prepare your environment.

Download the latest version of python and Microsoft c++ redistributable

Get the code.

  1. First thing you will need is an editor for your source code, that's a personal choice, but we would like to recommend PyCharm community edition, an excellent open-source python editor. PyCharm Community edition

  2. Run the installer, and follow the installation instructions for PyCharm, you may change a few options, but the default ones should be fine.

  3. Open PyCharm and click on "Get from Version Control".

pycharm welcome screen

You can find it also at VCS -> Get from Version Control...

pycharm get from version control

  1. Select Git as the version control, and set the URL to libs repository as shown in the picture. At the website, copy the URL from Clone -> Clone with HTTPS.

pycharm get from version control screen

You may need to install Git, by clicking at Download and install. If that message does not appear is because you have it already installed in your computer.

  1. Click Clone to download CERC libs source code. You will end with a project like this:

pycharm project screen

Configure PyCharm.

We use two spaces as a tab instead of standard pep8 four spaces indentation. This option can be configured in PyCharm at the settings screen, as shown in the picture.

pycharm configuration screen

Start your project.

  1. Click on File -> New Project... The following window opens:

pycharm new project screen

Add a name to your project and click Create.

  1. Go to project settings and add the libs project to your own, by clicking on Add Content Root:

pycharm new project screen

pycharm add libs

  1. Add your first file to your project and click on install requirements to automatically download all the dependencies (in blue at top-right corner).

pycharm add dependencies

  1. When all the dependencies are satisfied, you are all set to start importing your first city model.

Add the following code to your main.py


from imports.geometry_factory import GeometryFactory

city = GeometryFactory('citygml', 'myfile.gml').city

The rest depends on you. Have fun!