SlideShare a Scribd company logo
GeoScript
Ilya Rosenfeld | OpenGeo | Spring 2013
The Big Idea


      A library for processing of spatial data

Several implementations for scripting environments

Currently in Python, Groovy, JavaScript, Scala, Ruby

             GeoTools under the hood
Why GeoScript
        Easy to learn

        Simple to use

  Familiar spatial metaphors

Choice of a scripting language

      Versatile products

Evolving, free and open source
"Succinctness is Power."
                   - Paul Graham
            Author or "Hackers and Painters"
Spatial Metaphors and API

 Geometry               Style
  Feature               Map
 Workspace           Projection
   Filter             Function
   Layer              Process


    http://www. geoscript.org
Load, style and display data ...
# import libraries
from geoscript.layer import Shapefile
from geoscript.render import draw
from geoscript.style import *

# load data
solar = Shapefile("solar_dni_polygons_fla.shp")

# style and display it
solar.style = Stroke("blue")
draw(solar)
... output
Examine data ...
# show structure of the data
solar.schema

# print out a single attribute for each record
for f in states.features():
    print f["STATE"]


# aggregate all values of "DEC" attribute
list = [f.get("DEC") for f in solar.features()]
reduce(lambda a,b: a+b, list)
... output
shapefile's schema:
solar_dni_polygons_fla [the_geom: MultiPolygon, ID: long,
GRIDCODE: float, ANN_DNI: float, JAN: float, FEB: float, MAR:
float, APR: float, MAY: float, JUN: float, JUL: float, AUG: float,
SEP: float, OCT: float, NOV: float, DEC: float]

"DEC" attribute values:
[4.268077957, 4.268077957, 4.268077957, 4.268077957...

aggregate value of "DEC":
6791.922061828683
Build a Histogram ...
# import
from geoscript.plot import bar

# populate data for X axis
x = [1,2,3,4,5,6,7,8,9,10]

# populate data for Y axis
y = [i * i for i in x]

# draw histogram
bar.xy(zip(x,y)).show()
... output
GeoScript Processes
AddCoverages, AreaGrid, Contour, CropCoverage, MultiplyCoverages,
PolygonExtraction, RangeLookup, RasterAsPointCollection, RasterZonalStatistics,
ScaleCoverage, StyleCoverage, length, isEmpty, contains, disjoint, intersects,
isClosed, isValid, buffer, getY, getX, union, intersection, difference, distance,
envelope, dimension, overlaps, reproject, simplify, isSimple, equalsExact,
getGeometryN, isWithinDistance, touches, crosses, within, relate, convexHull,
symDifference, centroid, interiorPoint, numPoints, area, isRing, exteriorRing,
numInteriorRing, numGeometries, geometryType, boundary, relatePattern,
equalsExactTolerance, pointN, startPoint, endPoint, interiorRingN, densify,
polygonize, splitPolygon, Aggregate, BarnesSurface, Bounds,
BufferFeatureCollection, Centroid, Clip, CollectGeometries, Count, Feature, Grid,
Heatmap, InclusionFeatureCollection, IntersectionFeatureCollection, LRSGeocode,
LRSMeasure, LRSSegment, Nearest, PointBuffers, PointStacker, Query,
RectangularClip, Reproject, Simplify, Snap, Transform, UnionFeatureCollection,
Unique, VectorToRaster, VectorZonalStatistics, ...

+ WRITE YOUR OWN
Run a process ...
# import
from geoscript.process import Process

# bind to a process and examine its inputs
p = Process.lookup("vec:Centroid")
p.inputs

# execute process
centroids = p.run(features=solar).get("result")

# draw result
draw(centroids)
... output
>> Establishing Internet Connection ...
OGC WPS                                   input                            output

In a nutshell:

●   WPS: Web Processing Service
●   web service interface standard
●   standardizes metadata, inputs and outputs of a (spatial) process
●   defines how a client can execute the process
●   implementation: some processing algorithm

OGC WPS [HTTP] Operations:

●   GetCapabilities:      returns service metadata
●   DescribeProcess:      returns description of a process, its inputs and outputs
●   Execute:              returns output of a process
WPS How-to



Step 1: Hack GeoScript from command line.
Step 2: Wrap your code in a Process.
Step 3: Copy to GeoServer.


                            It lives, it runs!
WPS Example


    origin




 http://suite.opengeo.org/docs/processing/scripting/processcreate.html
Process Inputs and Outputs
vector
 inputs
   ● GML                           outputs
   ● WKT                            ● WKT
   ● HTTP reference                 ● GML
   ● subprocess                     ● Shapefile ZIP
   ● feature collection             ● ...
        ○ WFS collection
        ○ JSON
        ○ Shapefile ZIP
        ○ HTTP request
        ○ GeoServer VECTOR_LAYER
        ○ subprocess

                                   outputs
raster                              ● TIFF
 inputs                             ● ArcGrid
   ● TIFF                           ● ...
   ● ArcGrid
   ● HTTP reference
   ● GeoServer RASTER_LAYER
   ● subprocess
Pushing Ahead
GeoScript                                Rendering Transformations
 ● do processing from command line        ● add advanced visualizations
 ● prototype and tweak your process       ● author transformations using SLD
 ● use local and remote resources         ● transform datasets in GeoServer

Process Chaining
 ● script complex processes
 ● wrap and deploy as a single service
Pushing Ahead
Web Mapping App Development             Integration
 ● use OpenGeo Suite SDK                 ● invoke WPS from another system
 ● create a starter app automatically    ● embed interactive maps into other apps
 ● customize, test and deploy
blog.opengeo.org
keyword: "solar"

More Related Content

What's hot

ScalaCache: simple caching in Scala
ScalaCache: simple caching in ScalaScalaCache: simple caching in Scala
ScalaCache: simple caching in Scala
Chris Birchall
 
NIIF Grid Development portfolio
NIIF Grid Development portfolioNIIF Grid Development portfolio
NIIF Grid Development portfolio
Ferenc Szalai
 
Google Kubernetes Engine (GKE) deep dive
Google Kubernetes Engine (GKE) deep diveGoogle Kubernetes Engine (GKE) deep dive
Google Kubernetes Engine (GKE) deep dive
Akash Agrawal
 
BaseX user-group-talk XML Prague 2013
BaseX user-group-talk XML Prague 2013BaseX user-group-talk XML Prague 2013
BaseX user-group-talk XML Prague 2013
Andy Bunce
 
Scalability and Performance of CNS 3.6
Scalability and Performance of CNS 3.6Scalability and Performance of CNS 3.6
Scalability and Performance of CNS 3.6
Gluster.org
 
Gluster containers!
Gluster containers!Gluster containers!
Gluster containers!
Humble Chirammal
 
Qemu gluster fs
Qemu gluster fsQemu gluster fs
Qemu gluster fs
Gluster.org
 
Power tools in Java
Power tools in JavaPower tools in Java
Power tools in Java
DPC Consulting Ltd
 
Google Cloud platform: GKE with CI/CD using CircleCI and Flux
Google Cloud platform: GKE with CI/CD using CircleCI and FluxGoogle Cloud platform: GKE with CI/CD using CircleCI and Flux
Google Cloud platform: GKE with CI/CD using CircleCI and Flux
komaldevg
 
Geode - Day 3
Geode - Day 3Geode - Day 3
Geode - Day 3
Swapnil Bawaskar
 
Mashing the data
Mashing the dataMashing the data
Mashing the data
Felix Crisan
 
Google Kubernetes Engine Deep Dive Meetup
Google Kubernetes Engine Deep Dive MeetupGoogle Kubernetes Engine Deep Dive Meetup
Google Kubernetes Engine Deep Dive Meetup
Iftach Schonbaum
 
Load testing with gatling
Load testing with gatlingLoad testing with gatling
Load testing with gatlingChris Birchall
 
Introducing Koki Short
Introducing Koki ShortIntroducing Koki Short
Introducing Koki Short
Sidhartha Mani
 
Gluster Containerized Storage for Cloud Applications
Gluster Containerized Storage for Cloud ApplicationsGluster Containerized Storage for Cloud Applications
Gluster Containerized Storage for Cloud Applications
Gluster.org
 
OpenNebulaConf2018 - OpenNebula and LXD Containers - Rubén S. Montero - OpenN...
OpenNebulaConf2018 - OpenNebula and LXD Containers - Rubén S. Montero - OpenN...OpenNebulaConf2018 - OpenNebula and LXD Containers - Rubén S. Montero - OpenN...
OpenNebulaConf2018 - OpenNebula and LXD Containers - Rubén S. Montero - OpenN...
OpenNebula Project
 
Gluster volume snapshot
Gluster volume snapshotGluster volume snapshot
Gluster volume snapshot
Rajesh Joseph
 
Hands On Gluster with Jeff Darcy
Hands On Gluster with Jeff DarcyHands On Gluster with Jeff Darcy
Hands On Gluster with Jeff Darcy
Gluster.org
 
OSBConf 2015 | Scale out backups with bareos and gluster by niels de vos
OSBConf 2015 | Scale out backups with bareos and gluster by niels de vosOSBConf 2015 | Scale out backups with bareos and gluster by niels de vos
OSBConf 2015 | Scale out backups with bareos and gluster by niels de vos
NETWAYS
 
TechDay - April - Customizing VM Images
TechDay - April - Customizing VM ImagesTechDay - April - Customizing VM Images
TechDay - April - Customizing VM Images
OpenNebula Project
 

What's hot (20)

ScalaCache: simple caching in Scala
ScalaCache: simple caching in ScalaScalaCache: simple caching in Scala
ScalaCache: simple caching in Scala
 
NIIF Grid Development portfolio
NIIF Grid Development portfolioNIIF Grid Development portfolio
NIIF Grid Development portfolio
 
Google Kubernetes Engine (GKE) deep dive
Google Kubernetes Engine (GKE) deep diveGoogle Kubernetes Engine (GKE) deep dive
Google Kubernetes Engine (GKE) deep dive
 
BaseX user-group-talk XML Prague 2013
BaseX user-group-talk XML Prague 2013BaseX user-group-talk XML Prague 2013
BaseX user-group-talk XML Prague 2013
 
Scalability and Performance of CNS 3.6
Scalability and Performance of CNS 3.6Scalability and Performance of CNS 3.6
Scalability and Performance of CNS 3.6
 
Gluster containers!
Gluster containers!Gluster containers!
Gluster containers!
 
Qemu gluster fs
Qemu gluster fsQemu gluster fs
Qemu gluster fs
 
Power tools in Java
Power tools in JavaPower tools in Java
Power tools in Java
 
Google Cloud platform: GKE with CI/CD using CircleCI and Flux
Google Cloud platform: GKE with CI/CD using CircleCI and FluxGoogle Cloud platform: GKE with CI/CD using CircleCI and Flux
Google Cloud platform: GKE with CI/CD using CircleCI and Flux
 
Geode - Day 3
Geode - Day 3Geode - Day 3
Geode - Day 3
 
Mashing the data
Mashing the dataMashing the data
Mashing the data
 
Google Kubernetes Engine Deep Dive Meetup
Google Kubernetes Engine Deep Dive MeetupGoogle Kubernetes Engine Deep Dive Meetup
Google Kubernetes Engine Deep Dive Meetup
 
Load testing with gatling
Load testing with gatlingLoad testing with gatling
Load testing with gatling
 
Introducing Koki Short
Introducing Koki ShortIntroducing Koki Short
Introducing Koki Short
 
Gluster Containerized Storage for Cloud Applications
Gluster Containerized Storage for Cloud ApplicationsGluster Containerized Storage for Cloud Applications
Gluster Containerized Storage for Cloud Applications
 
OpenNebulaConf2018 - OpenNebula and LXD Containers - Rubén S. Montero - OpenN...
OpenNebulaConf2018 - OpenNebula and LXD Containers - Rubén S. Montero - OpenN...OpenNebulaConf2018 - OpenNebula and LXD Containers - Rubén S. Montero - OpenN...
OpenNebulaConf2018 - OpenNebula and LXD Containers - Rubén S. Montero - OpenN...
 
Gluster volume snapshot
Gluster volume snapshotGluster volume snapshot
Gluster volume snapshot
 
Hands On Gluster with Jeff Darcy
Hands On Gluster with Jeff DarcyHands On Gluster with Jeff Darcy
Hands On Gluster with Jeff Darcy
 
OSBConf 2015 | Scale out backups with bareos and gluster by niels de vos
OSBConf 2015 | Scale out backups with bareos and gluster by niels de vosOSBConf 2015 | Scale out backups with bareos and gluster by niels de vos
OSBConf 2015 | Scale out backups with bareos and gluster by niels de vos
 
TechDay - April - Customizing VM Images
TechDay - April - Customizing VM ImagesTechDay - April - Customizing VM Images
TechDay - April - Customizing VM Images
 

Viewers also liked

Crowd sourcing docket_ss
Crowd sourcing docket_ssCrowd sourcing docket_ss
Crowd sourcing docket_ss
Nanjunda Pratap Palecanda
 
Funding collaborative research_workshop_tech_congress_2013
Funding collaborative research_workshop_tech_congress_2013Funding collaborative research_workshop_tech_congress_2013
Funding collaborative research_workshop_tech_congress_2013
Nanjunda Pratap Palecanda
 
Πρόγραμμα επιμόρφωσης εκπαιδευτικών στην η-τάξη μέσω της η-τάξης
Πρόγραμμα επιμόρφωσης εκπαιδευτικών στην η-τάξη μέσω της η-τάξηςΠρόγραμμα επιμόρφωσης εκπαιδευτικών στην η-τάξη μέσω της η-τάξης
Πρόγραμμα επιμόρφωσης εκπαιδευτικών στην η-τάξη μέσω της η-τάξης
Konstantinos Dragogiannis
 
Thesis defense presentation jve 2013.01.07
Thesis defense presentation jve 2013.01.07Thesis defense presentation jve 2013.01.07
Thesis defense presentation jve 2013.01.07Jean Vercruysse
 
Βαθμός αποδοχής της Υπηρεσίας VoIP από εκπαιδευτικούς και σχολικές μονάδες Πρ...
Βαθμός αποδοχής της Υπηρεσίας VoIP από εκπαιδευτικούς και σχολικές μονάδες Πρ...Βαθμός αποδοχής της Υπηρεσίας VoIP από εκπαιδευτικούς και σχολικές μονάδες Πρ...
Βαθμός αποδοχής της Υπηρεσίας VoIP από εκπαιδευτικούς και σχολικές μονάδες Πρ...
Konstantinos Dragogiannis
 
Παρελθόν και μέλλον υπηρεσίας της Ηλεκτρονικής Σχολικής Τάξης του Πανελλήνιου...
Παρελθόν και μέλλον υπηρεσίας της Ηλεκτρονικής Σχολικής Τάξης του Πανελλήνιου...Παρελθόν και μέλλον υπηρεσίας της Ηλεκτρονικής Σχολικής Τάξης του Πανελλήνιου...
Παρελθόν και μέλλον υπηρεσίας της Ηλεκτρονικής Σχολικής Τάξης του Πανελλήνιου...
Konstantinos Dragogiannis
 
Indian Technology congress 2013
Indian Technology congress 2013Indian Technology congress 2013
Indian Technology congress 2013
Nanjunda Pratap Palecanda
 
Αξιολόγηση μαθησιακής αποτελεσματικότητας συστημάτων διαχείρισης μάθησης στην...
Αξιολόγηση μαθησιακής αποτελεσματικότητας συστημάτων διαχείρισης μάθησης στην...Αξιολόγηση μαθησιακής αποτελεσματικότητας συστημάτων διαχείρισης μάθησης στην...
Αξιολόγηση μαθησιακής αποτελεσματικότητας συστημάτων διαχείρισης μάθησης στην...
Konstantinos Dragogiannis
 
Ppt hmk buat web
Ppt hmk buat webPpt hmk buat web
Ppt hmk buat web
hmk165
 
Mba thesis defense presentation jve 2013.01.17
Mba thesis defense presentation jve 2013.01.17Mba thesis defense presentation jve 2013.01.17
Mba thesis defense presentation jve 2013.01.17
Jean Vercruysse
 
Final azshrm state 2013 conf
Final azshrm state 2013 confFinal azshrm state 2013 conf
Final azshrm state 2013 conf
Micki Schroeder, PHR
 
2013 AZSHRM State Conference
2013 AZSHRM State Conference2013 AZSHRM State Conference
2013 AZSHRM State Conference
Micki Schroeder, PHR
 

Viewers also liked (13)

Crowd sourcing docket_ss
Crowd sourcing docket_ssCrowd sourcing docket_ss
Crowd sourcing docket_ss
 
Funding collaborative research_workshop_tech_congress_2013
Funding collaborative research_workshop_tech_congress_2013Funding collaborative research_workshop_tech_congress_2013
Funding collaborative research_workshop_tech_congress_2013
 
Πρόγραμμα επιμόρφωσης εκπαιδευτικών στην η-τάξη μέσω της η-τάξης
Πρόγραμμα επιμόρφωσης εκπαιδευτικών στην η-τάξη μέσω της η-τάξηςΠρόγραμμα επιμόρφωσης εκπαιδευτικών στην η-τάξη μέσω της η-τάξης
Πρόγραμμα επιμόρφωσης εκπαιδευτικών στην η-τάξη μέσω της η-τάξης
 
Agile estimation
Agile estimationAgile estimation
Agile estimation
 
Thesis defense presentation jve 2013.01.07
Thesis defense presentation jve 2013.01.07Thesis defense presentation jve 2013.01.07
Thesis defense presentation jve 2013.01.07
 
Βαθμός αποδοχής της Υπηρεσίας VoIP από εκπαιδευτικούς και σχολικές μονάδες Πρ...
Βαθμός αποδοχής της Υπηρεσίας VoIP από εκπαιδευτικούς και σχολικές μονάδες Πρ...Βαθμός αποδοχής της Υπηρεσίας VoIP από εκπαιδευτικούς και σχολικές μονάδες Πρ...
Βαθμός αποδοχής της Υπηρεσίας VoIP από εκπαιδευτικούς και σχολικές μονάδες Πρ...
 
Παρελθόν και μέλλον υπηρεσίας της Ηλεκτρονικής Σχολικής Τάξης του Πανελλήνιου...
Παρελθόν και μέλλον υπηρεσίας της Ηλεκτρονικής Σχολικής Τάξης του Πανελλήνιου...Παρελθόν και μέλλον υπηρεσίας της Ηλεκτρονικής Σχολικής Τάξης του Πανελλήνιου...
Παρελθόν και μέλλον υπηρεσίας της Ηλεκτρονικής Σχολικής Τάξης του Πανελλήνιου...
 
Indian Technology congress 2013
Indian Technology congress 2013Indian Technology congress 2013
Indian Technology congress 2013
 
Αξιολόγηση μαθησιακής αποτελεσματικότητας συστημάτων διαχείρισης μάθησης στην...
Αξιολόγηση μαθησιακής αποτελεσματικότητας συστημάτων διαχείρισης μάθησης στην...Αξιολόγηση μαθησιακής αποτελεσματικότητας συστημάτων διαχείρισης μάθησης στην...
Αξιολόγηση μαθησιακής αποτελεσματικότητας συστημάτων διαχείρισης μάθησης στην...
 
Ppt hmk buat web
Ppt hmk buat webPpt hmk buat web
Ppt hmk buat web
 
Mba thesis defense presentation jve 2013.01.17
Mba thesis defense presentation jve 2013.01.17Mba thesis defense presentation jve 2013.01.17
Mba thesis defense presentation jve 2013.01.17
 
Final azshrm state 2013 conf
Final azshrm state 2013 confFinal azshrm state 2013 conf
Final azshrm state 2013 conf
 
2013 AZSHRM State Conference
2013 AZSHRM State Conference2013 AZSHRM State Conference
2013 AZSHRM State Conference
 

Similar to Geo script opengeo spring 2013

Scripting GeoServer
Scripting GeoServerScripting GeoServer
Scripting GeoServer
Jared Erickson
 
Extended and embedding: containerd update & project use cases
Extended and embedding: containerd update & project use casesExtended and embedding: containerd update & project use cases
Extended and embedding: containerd update & project use cases
Phil Estes
 
Improving Apache Spark Downscaling
 Improving Apache Spark Downscaling Improving Apache Spark Downscaling
Improving Apache Spark Downscaling
Databricks
 
CartoDB Inside Out
CartoDB Inside OutCartoDB Inside Out
CartoDB Inside Out
Jorge Sanz
 
Lightbend Lagom: Microservices Just Right
Lightbend Lagom: Microservices Just RightLightbend Lagom: Microservices Just Right
Lightbend Lagom: Microservices Just Right
mircodotta
 
Google App Engine Java, Groovy and Gaelyk
Google App Engine Java, Groovy and GaelykGoogle App Engine Java, Groovy and Gaelyk
Google App Engine Java, Groovy and Gaelyk
Guillaume Laforge
 
LocationTech Projects
LocationTech ProjectsLocationTech Projects
LocationTech Projects
Jody Garnett
 
Groovy and Grails intro
Groovy and Grails introGroovy and Grails intro
Groovy and Grails intro
Miguel Pastor
 
BigQuery case study in Groovenauts & Dive into the DataflowJavaSDK
BigQuery case study in Groovenauts & Dive into the DataflowJavaSDKBigQuery case study in Groovenauts & Dive into the DataflowJavaSDK
BigQuery case study in Groovenauts & Dive into the DataflowJavaSDK
nagachika t
 
Geospatial web services using little-known GDAL features and modern Perl midd...
Geospatial web services using little-known GDAL features and modern Perl midd...Geospatial web services using little-known GDAL features and modern Perl midd...
Geospatial web services using little-known GDAL features and modern Perl midd...
Ari Jolma
 
SF Big Analytics 20191112: How to performance-tune Spark applications in larg...
SF Big Analytics 20191112: How to performance-tune Spark applications in larg...SF Big Analytics 20191112: How to performance-tune Spark applications in larg...
SF Big Analytics 20191112: How to performance-tune Spark applications in larg...
Chester Chen
 
Drools, jBPM OptaPlanner presentation
Drools, jBPM OptaPlanner presentationDrools, jBPM OptaPlanner presentation
Drools, jBPM OptaPlanner presentation
Mark Proctor
 
LocationTech Meetup Hamburg 2014 - GeoGig
LocationTech Meetup Hamburg 2014 - GeoGigLocationTech Meetup Hamburg 2014 - GeoGig
LocationTech Meetup Hamburg 2014 - GeoGig
Frank Gasdorf
 
Open shift enterprise 3.1 paas on kubernetes
Open shift enterprise 3.1   paas on kubernetesOpen shift enterprise 3.1   paas on kubernetes
Open shift enterprise 3.1 paas on kubernetes
Samuel Terburg
 
Why Grails
Why GrailsWhy Grails
Why Grails
Yiguang Hu
 
Why Grails?
Why Grails?Why Grails?
Why Grails?
Yiguang Hu
 
Kubernetes上で動作する機械学習モジュールの配信&管理基盤Rekcurd について
Kubernetes上で動作する機械学習モジュールの配信&管理基盤Rekcurd についてKubernetes上で動作する機械学習モジュールの配信&管理基盤Rekcurd について
Kubernetes上で動作する機械学習モジュールの配信&管理基盤Rekcurd について
LINE Corporation
 
GIS on Rails by Oleksandr Kychun
GIS on Rails by Oleksandr Kychun GIS on Rails by Oleksandr Kychun
GIS on Rails by Oleksandr Kychun
Pivorak MeetUp
 
Running Airflow Workflows as ETL Processes on Hadoop
Running Airflow Workflows as ETL Processes on HadoopRunning Airflow Workflows as ETL Processes on Hadoop
Running Airflow Workflows as ETL Processes on Hadoop
clairvoyantllc
 

Similar to Geo script opengeo spring 2013 (20)

Grails 101
Grails 101Grails 101
Grails 101
 
Scripting GeoServer
Scripting GeoServerScripting GeoServer
Scripting GeoServer
 
Extended and embedding: containerd update & project use cases
Extended and embedding: containerd update & project use casesExtended and embedding: containerd update & project use cases
Extended and embedding: containerd update & project use cases
 
Improving Apache Spark Downscaling
 Improving Apache Spark Downscaling Improving Apache Spark Downscaling
Improving Apache Spark Downscaling
 
CartoDB Inside Out
CartoDB Inside OutCartoDB Inside Out
CartoDB Inside Out
 
Lightbend Lagom: Microservices Just Right
Lightbend Lagom: Microservices Just RightLightbend Lagom: Microservices Just Right
Lightbend Lagom: Microservices Just Right
 
Google App Engine Java, Groovy and Gaelyk
Google App Engine Java, Groovy and GaelykGoogle App Engine Java, Groovy and Gaelyk
Google App Engine Java, Groovy and Gaelyk
 
LocationTech Projects
LocationTech ProjectsLocationTech Projects
LocationTech Projects
 
Groovy and Grails intro
Groovy and Grails introGroovy and Grails intro
Groovy and Grails intro
 
BigQuery case study in Groovenauts & Dive into the DataflowJavaSDK
BigQuery case study in Groovenauts & Dive into the DataflowJavaSDKBigQuery case study in Groovenauts & Dive into the DataflowJavaSDK
BigQuery case study in Groovenauts & Dive into the DataflowJavaSDK
 
Geospatial web services using little-known GDAL features and modern Perl midd...
Geospatial web services using little-known GDAL features and modern Perl midd...Geospatial web services using little-known GDAL features and modern Perl midd...
Geospatial web services using little-known GDAL features and modern Perl midd...
 
SF Big Analytics 20191112: How to performance-tune Spark applications in larg...
SF Big Analytics 20191112: How to performance-tune Spark applications in larg...SF Big Analytics 20191112: How to performance-tune Spark applications in larg...
SF Big Analytics 20191112: How to performance-tune Spark applications in larg...
 
Drools, jBPM OptaPlanner presentation
Drools, jBPM OptaPlanner presentationDrools, jBPM OptaPlanner presentation
Drools, jBPM OptaPlanner presentation
 
LocationTech Meetup Hamburg 2014 - GeoGig
LocationTech Meetup Hamburg 2014 - GeoGigLocationTech Meetup Hamburg 2014 - GeoGig
LocationTech Meetup Hamburg 2014 - GeoGig
 
Open shift enterprise 3.1 paas on kubernetes
Open shift enterprise 3.1   paas on kubernetesOpen shift enterprise 3.1   paas on kubernetes
Open shift enterprise 3.1 paas on kubernetes
 
Why Grails
Why GrailsWhy Grails
Why Grails
 
Why Grails?
Why Grails?Why Grails?
Why Grails?
 
Kubernetes上で動作する機械学習モジュールの配信&管理基盤Rekcurd について
Kubernetes上で動作する機械学習モジュールの配信&管理基盤Rekcurd についてKubernetes上で動作する機械学習モジュールの配信&管理基盤Rekcurd について
Kubernetes上で動作する機械学習モジュールの配信&管理基盤Rekcurd について
 
GIS on Rails by Oleksandr Kychun
GIS on Rails by Oleksandr Kychun GIS on Rails by Oleksandr Kychun
GIS on Rails by Oleksandr Kychun
 
Running Airflow Workflows as ETL Processes on Hadoop
Running Airflow Workflows as ETL Processes on HadoopRunning Airflow Workflows as ETL Processes on Hadoop
Running Airflow Workflows as ETL Processes on Hadoop
 

Geo script opengeo spring 2013

  • 1. GeoScript Ilya Rosenfeld | OpenGeo | Spring 2013
  • 2. The Big Idea A library for processing of spatial data Several implementations for scripting environments Currently in Python, Groovy, JavaScript, Scala, Ruby GeoTools under the hood
  • 3. Why GeoScript Easy to learn Simple to use Familiar spatial metaphors Choice of a scripting language Versatile products Evolving, free and open source
  • 4. "Succinctness is Power." - Paul Graham Author or "Hackers and Painters"
  • 5. Spatial Metaphors and API Geometry Style Feature Map Workspace Projection Filter Function Layer Process http://www. geoscript.org
  • 6. Load, style and display data ... # import libraries from geoscript.layer import Shapefile from geoscript.render import draw from geoscript.style import * # load data solar = Shapefile("solar_dni_polygons_fla.shp") # style and display it solar.style = Stroke("blue") draw(solar)
  • 8. Examine data ... # show structure of the data solar.schema # print out a single attribute for each record for f in states.features(): print f["STATE"] # aggregate all values of "DEC" attribute list = [f.get("DEC") for f in solar.features()] reduce(lambda a,b: a+b, list)
  • 9. ... output shapefile's schema: solar_dni_polygons_fla [the_geom: MultiPolygon, ID: long, GRIDCODE: float, ANN_DNI: float, JAN: float, FEB: float, MAR: float, APR: float, MAY: float, JUN: float, JUL: float, AUG: float, SEP: float, OCT: float, NOV: float, DEC: float] "DEC" attribute values: [4.268077957, 4.268077957, 4.268077957, 4.268077957... aggregate value of "DEC": 6791.922061828683
  • 10. Build a Histogram ... # import from geoscript.plot import bar # populate data for X axis x = [1,2,3,4,5,6,7,8,9,10] # populate data for Y axis y = [i * i for i in x] # draw histogram bar.xy(zip(x,y)).show()
  • 12. GeoScript Processes AddCoverages, AreaGrid, Contour, CropCoverage, MultiplyCoverages, PolygonExtraction, RangeLookup, RasterAsPointCollection, RasterZonalStatistics, ScaleCoverage, StyleCoverage, length, isEmpty, contains, disjoint, intersects, isClosed, isValid, buffer, getY, getX, union, intersection, difference, distance, envelope, dimension, overlaps, reproject, simplify, isSimple, equalsExact, getGeometryN, isWithinDistance, touches, crosses, within, relate, convexHull, symDifference, centroid, interiorPoint, numPoints, area, isRing, exteriorRing, numInteriorRing, numGeometries, geometryType, boundary, relatePattern, equalsExactTolerance, pointN, startPoint, endPoint, interiorRingN, densify, polygonize, splitPolygon, Aggregate, BarnesSurface, Bounds, BufferFeatureCollection, Centroid, Clip, CollectGeometries, Count, Feature, Grid, Heatmap, InclusionFeatureCollection, IntersectionFeatureCollection, LRSGeocode, LRSMeasure, LRSSegment, Nearest, PointBuffers, PointStacker, Query, RectangularClip, Reproject, Simplify, Snap, Transform, UnionFeatureCollection, Unique, VectorToRaster, VectorZonalStatistics, ... + WRITE YOUR OWN
  • 13. Run a process ... # import from geoscript.process import Process # bind to a process and examine its inputs p = Process.lookup("vec:Centroid") p.inputs # execute process centroids = p.run(features=solar).get("result") # draw result draw(centroids)
  • 15. >> Establishing Internet Connection ...
  • 16. OGC WPS input output In a nutshell: ● WPS: Web Processing Service ● web service interface standard ● standardizes metadata, inputs and outputs of a (spatial) process ● defines how a client can execute the process ● implementation: some processing algorithm OGC WPS [HTTP] Operations: ● GetCapabilities: returns service metadata ● DescribeProcess: returns description of a process, its inputs and outputs ● Execute: returns output of a process
  • 17. WPS How-to Step 1: Hack GeoScript from command line. Step 2: Wrap your code in a Process. Step 3: Copy to GeoServer. It lives, it runs!
  • 18. WPS Example origin http://suite.opengeo.org/docs/processing/scripting/processcreate.html
  • 19. Process Inputs and Outputs vector inputs ● GML outputs ● WKT ● WKT ● HTTP reference ● GML ● subprocess ● Shapefile ZIP ● feature collection ● ... ○ WFS collection ○ JSON ○ Shapefile ZIP ○ HTTP request ○ GeoServer VECTOR_LAYER ○ subprocess outputs raster ● TIFF inputs ● ArcGrid ● TIFF ● ... ● ArcGrid ● HTTP reference ● GeoServer RASTER_LAYER ● subprocess
  • 20. Pushing Ahead GeoScript Rendering Transformations ● do processing from command line ● add advanced visualizations ● prototype and tweak your process ● author transformations using SLD ● use local and remote resources ● transform datasets in GeoServer Process Chaining ● script complex processes ● wrap and deploy as a single service
  • 21. Pushing Ahead Web Mapping App Development Integration ● use OpenGeo Suite SDK ● invoke WPS from another system ● create a starter app automatically ● embed interactive maps into other apps ● customize, test and deploy