GeoPython Workshop Plan

Aus Geoinformation HSR
Version vom 13. April 2017, 16:08 Uhr von Simran (Diskussion | Beiträge) (Die Seite wurde neu angelegt: «=== Getting the Data === We will be using two vector files from [http://www.naturalearthdata.com/downloads/50m-cultural-vectors/ Natural Earth]. * Admin 0 - Cou…»)

(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)
Wechseln zu: Navigation, Suche

Getting the Data

We will be using two vector files from Natural Earth.

  • Admin 0 - Countries
  • Populated Places (Simple)

Custom Python Expression Functions Use Cases

  • Select by Expression
- Select all the capital cities with population greater than the average population (or user-defined number). Find out the average population first.
- Select points based on their UTM Zone?
- Select the country in the country layer that has the maximum number of populated places in the populated places layer.
  • Field Calculator
(a) In the Populated Places attribute table, create a new field, 'hemisphere' which can be North or South depending on the latitude value. OR
(b) Use Nominatim's reverse geocoder to find the full address for that latitude longitude. Write a Python function uses the API. See Nominatim wiki and the example: http://nominatim.openstreetmap.org/reverse?format=xml&lat=52.5487429714954&lon=-1.81602098644987&zoom=18&addressdetails=1
  • Get the value of the env variable and do something with it
- Get the layer_name or layer_id of the Countries layer using get_env(). (Write function to set a new variable, layer_colour, according to the user defined colour. Usage: set_env()) ?
  • Label using Expression functions
- name | population surge in percentage | , | three letter country code