Giter Site home page Giter Site logo

simple_geo's Introduction

Python Client API for Web Services (WFS and WTSS)

Building and installing simple_geo.py from source

1. In the shell, type

  git clone https://github.com/vconrado/simple_geo.py.git
  cd simple_geo.py/src
  pip install .

Using simple_geo.py

Retrieving Features

from simple_geo import simple_geo as sgeo 

# Connecting to servers
b = sgeo(wfs="http://localhost:8080/geoserver-esensing/",
        wtss="http://localhost:7654")

# Retrieving the list of all available features in the service
ft_list = b.list_features()
print(cv_list)

# Retrieving the metadata of a given feature
ft_scheme = b.describe_feature("esensing:focos_bra_2016")
print(cv_scheme)

# Retrieving the collection for a given feature
fc, fc_metadata = b.feature_collection("esensing:focos_bra_2016")

# Retrieving a selected elements for a given feature
fc, fc_metadata = b.feature_collection("esensing:focos_bra_2016",
                                       attributes=("id", "municipio", "timestamp", "regiao"),
                                       within="POLYGON((-49.515628859948507 -19.394602563415745,-48.020567850467053 -19.610579617637825,-48.354439522883652 -21.052347219666608,-49.849500507163917 -20.836369963642884,-49.515628859948507 -19.394602563415745))",
                                       filter=["satelite_referencia='true'", "timestamp>='2016-01-01'",
                                               "timestamp<'2016-02-01'"],
                                       sort_by=("regiao", "municipio"),
                                       max_features=10)
print(fc)

# Retrieving collection length of selected elements for a given feature
fc_len = b.feature_collection_len("esensing:focos_bra_2016",
                                  within="POLYGON((-49.515628859948507 -19.394602563415745,-48.020567850467053 -19.610579617637825,-48.354439522883652 -21.052347219666608,-49.849500507163917 -20.836369963642884,-49.515628859948507 -19.394602563415745))",
                                  filter=["satelite_referencia='true'", "timestamp>='2016-01-01'",
                                          "timestamp<'2016-02-01'"])
print(fc_len)

Retrieving Coverages

from simple_geo import simple_geo as sgeo

# Connecting to servers
b = sgeo(wfs="http://localhost:8080/geoserver-esensing/",
        wtss="http://localhost:7654")

# Retrieving the list of all available coverages in the service
cv_list = b.list_coverages()
print(cv_list)

# Retrieving the metadata of a given coverage
cv_scheme = b.describe_coverage("climatologia")
print(cv_scheme)

# Retrieving the time series for a given location
ts, ts_metadata = b.time_series("climatologia", ("precipitation", "temperature", "humidity"), -12, -54)
print(ts)
print(ts_metadata)

simple_geo's People

Contributors

vconrado avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.