SlideShare a Scribd company logo
1 of 25
PYTHONSCRIPTS SOM WPS
WEBTJENESTE MED PYWPS
2015-11-17
1
MORTEN FUGLSANG, PH.D. GEOINFORMATIK, KONSULENT SWECO
Indhold
• WPS – hvad er det og hvordan bruger vi
standarden
• WPS 1.0 og 2.0
• Udbudet af WPS applikationer
• WPS service eksempel med PyWPS
• Eksempel projekt fra AAU
• Afslutning
2015-11-17
MORTEN FUGLSANG, SWECO, KORTDAGE 2015 2
WPS som standard
• Web Processing Service er standard for hvordan algoritmer
og værktøjer kan udstilles som web services
• Defineret til brug for geospatiale processer, men kan i
praksis benyttes til mange andre formål
2015-11-17
MORTEN FUGLSANG, SWECO, KORTDAGE 2015 3
Fra request til resultat med WPS WPS
10.01.2015 4
WPS forespørgsler
–WPS benytter samme type struktur som en WFS
–Getcapabilities
–DescribeProcess
–Execute
2015-11-17
MORTEN FUGLSANG, SWECO, KORTDAGE 2015 5
WPS udbydere
2015-11-17
MORTEN FUGLSANG, SWECO, KORTDAGE 2015 6
• OSGeo projekt – Selve kernen er skrevet I
C, men processer kan kodes I en lang
række sprog.
• http://www.zoo-project.org/
• Java-baseret wps applikation.
• Benytter JTS til datahåndtering ind og ud af
WPS’erne
• Integration til GRASS, R, Sextante,
Mapserver/Geoserver og ArcGIS server
• http://52north.org/communities/geoprocessin
g/wps/
WPS udbydere
2015-11-17
MORTEN FUGLSANG, SWECO, KORTDAGE 2015 7
• Mulighed for at udstille WPs’er direkte I det
velkendte Geoserver interface
• Processer kodes i java
• OSGeo projekt
• Alt er Python – både konfiguration og
processer
• Integration til GRASS, Mapserver m.m.
WPS benchmark programmet
• I forbindelse med FOSS4G afholdes normalt en session om WPS, hvor de
forskellige software-udviklere tester deres programmer mod hinanden.
– Der gik dog lidt koks i det i år, da ikke alle kunne tage til Seul…
• I 2014 testede :
• Man tester Geoprocesserings algoritmer, synkrone processer kørt som GET og
POST processer
– Arbejdet kan løbende følges her : http://lists.osgeo.org/mailman/listinfo/wps-
discuss
2015-11-17
MORTEN FUGLSANG, SWECO, KORTDAGE 2015 8
WPS 2.0
• 29 Juni 2015 blev WPS 2.0 standarden accepteret af OGC
• WPS 1.0 var fra 2007, så den trængte til en overhaling.
• Nye standard operatorer er tilføjet til de allerede
eksisterende :
2015-11-17
MORTEN FUGLSANG, SWECO, KORTDAGE 2015 9
WPS 2.0 – asynkron afvikling
2015-11-17
MORTEN FUGLSANG, SWECO, KORTDAGE 2015 10
• Processer kan nu køres
asynkront.
• Der kan spørges til status på en
kørende opgave
PyWPS
• PyWPS er eksemplet på en WPS udbyder som vi skal bruge
til at lave en tjeneste nu.
• Målsætningen bag projektet var, at gøre det muligt at publicere
GRASS processer som WPS
• Skrevet i python, og kører gennem en apacheserver via CGI-
scripts
10.01.2015 11Morten Fuglsang – So ein GIS ding 1MORTEN FUGLSANG, SWECO, KORTDAGE 2015
Funktioner og metoder
• Konfigurere PyWPS mod alverdens moduler, Numpy, Shapely,
GRASS eller PyQGIS
• Metoder :
–Getcapabilities
–DescribeProcess
–Execute
• Input og output typer:
–Literal (text)
–Complex (data - GML, GeoJson, Shapefiler og Geotiff)
–Boundingbox
10.01.2015 12Morten Fuglsang – So ein GIS ding 1MORTEN FUGLSANG, SWECO, KORTDAGE 2015
Eksempel på sevice
• Vi tager et pythonscript der beregner et servicearea i
PgRouting og omstiller til en WPS
• Modellen benytter drive_distance funktionen fra PgRouting
• Vi skal have et centerpunkt, en transport-type og en tid for at
beregne oplandet – og udfører tre opgaver:
1. Placer startpunktet i netværksgrafen
2. Beregn oplandet
3. Formater output
10.01.2015 13Morten Fuglsang – So ein GIS ding 1MORTEN FUGLSANG, SWECO, KORTDAGE 2015
Definerer processen
10.01.2015 14Morten Fuglsang – So ein GIS ding 1MORTEN FUGLSANG, SWECO, KORTDAGE 2015
Opsætter inputs
2015-11-17
MORTEN FUGLSANG, SWECO, KORTDAGE 2015 15
Bestemmer typen af transport
2015-11-17
MORTEN FUGLSANG, SWECO, KORTDAGE 2015 16
Udfører beregningen
2015-11-17
MORTEN FUGLSANG, SWECO, KORTDAGE 2015 17
Kalde processen
http://yourhostname/cgi-bin/pywps.cgi
?Service=wps
&request=execute
&version=1.0.0
&Identifyer=servicearea
&DataInputs=[x=520000;y=6250000;mode=1;val=15]
10.01.2015 18Morten Fuglsang – So ein GIS ding 1MORTEN FUGLSANG, SWECO, KORTDAGE 2015
Resultatet i et webGISatet
10.01.2015 19Morten Fuglsang – So ein GIS ding 1MORTEN FUGLSANG, SWECO, KORTDAGE 2015
Eksempel projekt
• Ioannis Angelidis, David
Nagy og Emil M.
Rasmussen (2015)
• “FloodTool 2.0 - An online
open source application for
flood modelling”
2015-11-17
MORTEN FUGLSANG, SWECO, KORTDAGE 2015 20
Resultat applikation
2015-11-17
MORTEN FUGLSANG, SWECO, KORTDAGE 2015 21
Perspektivering
• Usability
• PyWPS har ingen data ind/ud rutiner – det skal du selv lave som en del af
dit script.
• Der findes en kobling til Mapserver så resultat kan leveres som WMS
• Konfigurationsmæssigt kan det være noget bøvlet at få sat op…
• Performance
• Den overhead som PyWPS lægger på afviklingen af pythonscriptet er
minimal
• I situationer hvor store datamængder skal uploades, så tager det
selvfølgelig tid.
2015-11-17
MORTEN FUGLSANG, SWECO, KORTDAGE 2015 22
Perspektivering - fortsat
• Sikkerhed og datasikkerhed
• Ligesom med datarutinerne, så er der heller ingen brugerstyring – dette kan
dog skrives direkte i processerne
• Data udveksles med WPS serveren, derfor skal brugen af følsomme data
overvejes nøje.
• WebGIS kontra dekstop GIS
• Med WPS 2.0 og asynkrone processer kan vi komme meget tæt på at
kunne udbyde store komplekse arbejdsgange som webtools
2015-11-17
MORTEN FUGLSANG, SWECO, KORTDAGE 2015 23
Tak for opmærksomheden…
• Email : mortenwinther.fuglsang@sweco.dk
2015-11-17MORTEN FUGLSANG, SWECO, KORTDAGE 2015
24
Pythonscripts som WPS webtjeneste med PyWPS.

More Related Content

Featured

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Pythonscripts som WPS webtjeneste med PyWPS.

  • 1. PYTHONSCRIPTS SOM WPS WEBTJENESTE MED PYWPS 2015-11-17 1 MORTEN FUGLSANG, PH.D. GEOINFORMATIK, KONSULENT SWECO
  • 2. Indhold • WPS – hvad er det og hvordan bruger vi standarden • WPS 1.0 og 2.0 • Udbudet af WPS applikationer • WPS service eksempel med PyWPS • Eksempel projekt fra AAU • Afslutning 2015-11-17 MORTEN FUGLSANG, SWECO, KORTDAGE 2015 2
  • 3. WPS som standard • Web Processing Service er standard for hvordan algoritmer og værktøjer kan udstilles som web services • Defineret til brug for geospatiale processer, men kan i praksis benyttes til mange andre formål 2015-11-17 MORTEN FUGLSANG, SWECO, KORTDAGE 2015 3
  • 4. Fra request til resultat med WPS WPS 10.01.2015 4
  • 5. WPS forespørgsler –WPS benytter samme type struktur som en WFS –Getcapabilities –DescribeProcess –Execute 2015-11-17 MORTEN FUGLSANG, SWECO, KORTDAGE 2015 5
  • 6. WPS udbydere 2015-11-17 MORTEN FUGLSANG, SWECO, KORTDAGE 2015 6 • OSGeo projekt – Selve kernen er skrevet I C, men processer kan kodes I en lang række sprog. • http://www.zoo-project.org/ • Java-baseret wps applikation. • Benytter JTS til datahåndtering ind og ud af WPS’erne • Integration til GRASS, R, Sextante, Mapserver/Geoserver og ArcGIS server • http://52north.org/communities/geoprocessin g/wps/
  • 7. WPS udbydere 2015-11-17 MORTEN FUGLSANG, SWECO, KORTDAGE 2015 7 • Mulighed for at udstille WPs’er direkte I det velkendte Geoserver interface • Processer kodes i java • OSGeo projekt • Alt er Python – både konfiguration og processer • Integration til GRASS, Mapserver m.m.
  • 8. WPS benchmark programmet • I forbindelse med FOSS4G afholdes normalt en session om WPS, hvor de forskellige software-udviklere tester deres programmer mod hinanden. – Der gik dog lidt koks i det i år, da ikke alle kunne tage til Seul… • I 2014 testede : • Man tester Geoprocesserings algoritmer, synkrone processer kørt som GET og POST processer – Arbejdet kan løbende følges her : http://lists.osgeo.org/mailman/listinfo/wps- discuss 2015-11-17 MORTEN FUGLSANG, SWECO, KORTDAGE 2015 8
  • 9. WPS 2.0 • 29 Juni 2015 blev WPS 2.0 standarden accepteret af OGC • WPS 1.0 var fra 2007, så den trængte til en overhaling. • Nye standard operatorer er tilføjet til de allerede eksisterende : 2015-11-17 MORTEN FUGLSANG, SWECO, KORTDAGE 2015 9
  • 10. WPS 2.0 – asynkron afvikling 2015-11-17 MORTEN FUGLSANG, SWECO, KORTDAGE 2015 10 • Processer kan nu køres asynkront. • Der kan spørges til status på en kørende opgave
  • 11. PyWPS • PyWPS er eksemplet på en WPS udbyder som vi skal bruge til at lave en tjeneste nu. • Målsætningen bag projektet var, at gøre det muligt at publicere GRASS processer som WPS • Skrevet i python, og kører gennem en apacheserver via CGI- scripts 10.01.2015 11Morten Fuglsang – So ein GIS ding 1MORTEN FUGLSANG, SWECO, KORTDAGE 2015
  • 12. Funktioner og metoder • Konfigurere PyWPS mod alverdens moduler, Numpy, Shapely, GRASS eller PyQGIS • Metoder : –Getcapabilities –DescribeProcess –Execute • Input og output typer: –Literal (text) –Complex (data - GML, GeoJson, Shapefiler og Geotiff) –Boundingbox 10.01.2015 12Morten Fuglsang – So ein GIS ding 1MORTEN FUGLSANG, SWECO, KORTDAGE 2015
  • 13. Eksempel på sevice • Vi tager et pythonscript der beregner et servicearea i PgRouting og omstiller til en WPS • Modellen benytter drive_distance funktionen fra PgRouting • Vi skal have et centerpunkt, en transport-type og en tid for at beregne oplandet – og udfører tre opgaver: 1. Placer startpunktet i netværksgrafen 2. Beregn oplandet 3. Formater output 10.01.2015 13Morten Fuglsang – So ein GIS ding 1MORTEN FUGLSANG, SWECO, KORTDAGE 2015
  • 14. Definerer processen 10.01.2015 14Morten Fuglsang – So ein GIS ding 1MORTEN FUGLSANG, SWECO, KORTDAGE 2015
  • 16. Bestemmer typen af transport 2015-11-17 MORTEN FUGLSANG, SWECO, KORTDAGE 2015 16
  • 19. Resultatet i et webGISatet 10.01.2015 19Morten Fuglsang – So ein GIS ding 1MORTEN FUGLSANG, SWECO, KORTDAGE 2015
  • 20. Eksempel projekt • Ioannis Angelidis, David Nagy og Emil M. Rasmussen (2015) • “FloodTool 2.0 - An online open source application for flood modelling” 2015-11-17 MORTEN FUGLSANG, SWECO, KORTDAGE 2015 20
  • 22. Perspektivering • Usability • PyWPS har ingen data ind/ud rutiner – det skal du selv lave som en del af dit script. • Der findes en kobling til Mapserver så resultat kan leveres som WMS • Konfigurationsmæssigt kan det være noget bøvlet at få sat op… • Performance • Den overhead som PyWPS lægger på afviklingen af pythonscriptet er minimal • I situationer hvor store datamængder skal uploades, så tager det selvfølgelig tid. 2015-11-17 MORTEN FUGLSANG, SWECO, KORTDAGE 2015 22
  • 23. Perspektivering - fortsat • Sikkerhed og datasikkerhed • Ligesom med datarutinerne, så er der heller ingen brugerstyring – dette kan dog skrives direkte i processerne • Data udveksles med WPS serveren, derfor skal brugen af følsomme data overvejes nøje. • WebGIS kontra dekstop GIS • Med WPS 2.0 og asynkrone processer kan vi komme meget tæt på at kunne udbyde store komplekse arbejdsgange som webtools 2015-11-17 MORTEN FUGLSANG, SWECO, KORTDAGE 2015 23
  • 24. Tak for opmærksomheden… • Email : mortenwinther.fuglsang@sweco.dk 2015-11-17MORTEN FUGLSANG, SWECO, KORTDAGE 2015 24