{"id":1637,"date":"2018-06-25T15:11:44","date_gmt":"2018-06-25T15:11:44","guid":{"rendered":"https:\/\/wetransform.eu\/?post_type=news-and-events&#038;p=1637"},"modified":"2022-07-28T08:47:58","modified_gmt":"2022-07-28T08:47:58","slug":"groovy-week-free-scripts","status":"publish","type":"news-and-events","link":"https:\/\/wetransform.to\/de\/neuigkeiten-veranstaltungen\/groovy-week-free-scripts\/","title":{"rendered":"It&#8217;s Groovy Week: Free scripts for hale\u00bbstudio"},"content":{"rendered":"<p>When you try to do something in hale\u00bbstudio that isn\u2019t possible with the out-of-the-box functionality, it offers several ways of creating that functionality yourself. The most accessible of these is to add your own transformation functions using Groovy scripting. There are several points where Groovy functions can be added:<\/p>\n<ul>\n<li>Type Transformation Functions<\/li>\n<li>Property Transformation Functions<\/li>\n<li>Custom Functions<\/li>\n<li>Post-processing scripts (only through the CLI)<\/li>\n<\/ul>\n<p>Groovy is superset of Java, i.e. any valid Java program is also a valid Groovy program. What it makes much easier than Java is the creation of data structures \u2013 no boilerplate constructors and initialisation and the like. Here are some key resources for learning Groovy:<\/p>\n<ul>\n<li><a href=\"http:\/\/groovy-lang.org\/documentation.html\">Groovy Language Documentation<\/a><\/li>\n<li><a href=\"https:\/\/groovy-playground.appspot.com\/\">Groovy Playground<\/a><\/li>\n<li><a href=\"http:\/\/help.halestudio.org\/latest\/index.jsp?topic=%2Feu.esdihumboldt.cst.doc.functions%2Ffunctions%2Feu.esdihumboldt.cst.functions.groovy.html\">Groovy Scripting in hale studio<\/a><\/li>\n<\/ul>\n<p>Often, you will be looking for some recipes and snippets to get started, and that is exactly what we will provide during this week: We will publish one Groovy Snippet per day. Each of my colleagues has selected their favourite script and will share it with all of you ?.<\/p>\n<p>Please note that this article assumes you have working knowledge of hale studio and know the <a href=\"http:\/\/help.halestudio.org\/latest\/nav\/0_3\">terminology<\/a>.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/wetransform.eu\/wp-content\/uploads\/2022\/05\/groovy-logo.png\" alt=\"The Groovy Logo, by Zorak1103, CC BY-SA 3.0, https:\/\/commons.wikimedia.org\/w\/index.php?curid=13358930\" \/><\/p>\n<h2>Monday's Script: Build Polygons from Lines (Thorsten)<\/h2>\n<p>This script is my personal favorite. While relatively complex, it shows a lot of useful approaches how to work with geometries in a Groovy script.<\/p>\n<p>This function was built for creating waterbody <code>Polygons<\/code> from <code>LineString<\/code> shore segments. It is executed in the context of a Merge type cell as a Greedy Groovy Script function. It takes a <code>MultiLineString<\/code> geometry with unsorted individual <code>LineStrings<\/code> and builds one to many polygons in a <code>MultiPolygon<\/code> from that input.<\/p>\n<p>This is the script:<\/p>\n<p><script src=\"https:\/\/gist.github.com\/JBoudewijn\/470412be649dbca7c66cd0fca855b8b0.js\"><\/script><\/p>\n<p>You can download this script <a href=\"https:\/\/github.com\/wetransform-os\/website-examples\/blob\/af7108ee8f5a838327c3e4b871850212c399e37c\/news\/resources\/polygonsFromLines.groovy\">here<\/a> and import it in hale studio as a Groovy snippet by going to File -&gt; Import -&gt; Groovy Snippet. Please note that it uses some protected functions, so you need to &quot;Lift Groovy Restrictions&quot; to execute the script. It furthermore assumes a certain geometry attribute name (<code>the_geom<\/code>) that you might have to change.<\/p>\n<p>Happy transforming!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When you try to do something in hale\u00bbstudio that isn\u2019t possible with the out-of-the-box functionality, it offers several ways of creating that functionality yourself. The most accessible of these is to add your own transformation functions using Groovy scripting. There are several points where Groovy functions can be added: Type Transformation Functions Property Transformation Functions [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[48],"tags":[47,21,46],"class_list":["post-1637","news-and-events","type-news-and-events","status-publish","hentry","category-tutorials","tag-groovy","tag-halestudio","tag-tutorial"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.3 (Yoast SEO v27.4) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>It&#039;s Groovy Week: Free scripts for hale\u00bbstudio - wetransform<\/title>\n<meta name=\"description\" content=\"hale\u00bbstudio offers more than out-of-the-box functionality. You can create your own transformation functions using Groovy scripts!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/wetransform.to\/de\/neuigkeiten-veranstaltungen\/groovy-week-free-scripts\/\" \/>\n<meta property=\"og:locale\" content=\"de_DE\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"It&#039;s Groovy Week: Free scripts for hale\u00bbstudio\" \/>\n<meta property=\"og:description\" content=\"hale\u00bbstudio offers more than out-of-the-box functionality. You can create your own transformation functions using Groovy scripts!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/wetransform.to\/de\/neuigkeiten-veranstaltungen\/groovy-week-free-scripts\/\" \/>\n<meta property=\"og:site_name\" content=\"wetransform\" \/>\n<meta property=\"article:modified_time\" content=\"2022-07-28T08:47:58+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/wetransform.eu\/wp-content\/uploads\/2022\/05\/groovy-logo.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@wetransformto\" \/>\n<meta name=\"twitter:label1\" content=\"Gesch\u00e4tzte Lesezeit\" \/>\n\t<meta name=\"twitter:data1\" content=\"2\u00a0Minuten\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/wetransform.to\\\/de\\\/neuigkeiten-veranstaltungen\\\/groovy-week-free-scripts\\\/\",\"url\":\"https:\\\/\\\/wetransform.to\\\/de\\\/neuigkeiten-veranstaltungen\\\/groovy-week-free-scripts\\\/\",\"name\":\"It's Groovy Week: Free scripts for hale\u00bbstudio - wetransform\",\"isPartOf\":{\"@id\":\"http:\\\/\\\/wetransform.to\\\/de\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/wetransform.to\\\/de\\\/neuigkeiten-veranstaltungen\\\/groovy-week-free-scripts\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/wetransform.to\\\/de\\\/neuigkeiten-veranstaltungen\\\/groovy-week-free-scripts\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/wetransform.eu\\\/wp-content\\\/uploads\\\/2022\\\/05\\\/groovy-logo.png\",\"datePublished\":\"2018-06-25T15:11:44+00:00\",\"dateModified\":\"2022-07-28T08:47:58+00:00\",\"description\":\"hale\u00bbstudio offers more than out-of-the-box functionality. You can create your own transformation functions using Groovy scripts!\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/wetransform.to\\\/de\\\/neuigkeiten-veranstaltungen\\\/groovy-week-free-scripts\\\/#breadcrumb\"},\"inLanguage\":\"de\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/wetransform.to\\\/de\\\/neuigkeiten-veranstaltungen\\\/groovy-week-free-scripts\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"de\",\"@id\":\"https:\\\/\\\/wetransform.to\\\/de\\\/neuigkeiten-veranstaltungen\\\/groovy-week-free-scripts\\\/#primaryimage\",\"url\":\"https:\\\/\\\/wetransform.eu\\\/wp-content\\\/uploads\\\/2022\\\/05\\\/groovy-logo.png\",\"contentUrl\":\"https:\\\/\\\/wetransform.eu\\\/wp-content\\\/uploads\\\/2022\\\/05\\\/groovy-logo.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/wetransform.to\\\/de\\\/neuigkeiten-veranstaltungen\\\/groovy-week-free-scripts\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/wetransform.to\\\/de\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"News & Events\",\"item\":\"https:\\\/\\\/wetransform.to\\\/de\\\/neuigkeiten-veranstaltungen\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"It&#8217;s Groovy Week: Free scripts for hale\u00bbstudio\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\\\/\\\/wetransform.to\\\/de\\\/#website\",\"url\":\"http:\\\/\\\/wetransform.to\\\/de\\\/\",\"name\":\"wetransform\",\"description\":\"Making environmental data useful and accessible\",\"publisher\":{\"@id\":\"http:\\\/\\\/wetransform.to\\\/de\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\\\/\\\/wetransform.to\\\/de\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"de\"},{\"@type\":\"Organization\",\"@id\":\"http:\\\/\\\/wetransform.to\\\/de\\\/#organization\",\"name\":\"wetransform\",\"url\":\"http:\\\/\\\/wetransform.to\\\/de\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"de\",\"@id\":\"http:\\\/\\\/wetransform.to\\\/de\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/wetransform.to\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/large-logo-whitebg.png\",\"contentUrl\":\"https:\\\/\\\/wetransform.to\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/large-logo-whitebg.png\",\"width\":1024,\"height\":1024,\"caption\":\"wetransform\"},\"image\":{\"@id\":\"http:\\\/\\\/wetransform.to\\\/de\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/x.com\\\/wetransformto\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/wetransform-gmbh\\\/\"]}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"It's Groovy Week: Free scripts for hale\u00bbstudio - wetransform","description":"hale\u00bbstudio offers more than out-of-the-box functionality. You can create your own transformation functions using Groovy scripts!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/wetransform.to\/de\/neuigkeiten-veranstaltungen\/groovy-week-free-scripts\/","og_locale":"de_DE","og_type":"article","og_title":"It's Groovy Week: Free scripts for hale\u00bbstudio","og_description":"hale\u00bbstudio offers more than out-of-the-box functionality. You can create your own transformation functions using Groovy scripts!","og_url":"https:\/\/wetransform.to\/de\/neuigkeiten-veranstaltungen\/groovy-week-free-scripts\/","og_site_name":"wetransform","article_modified_time":"2022-07-28T08:47:58+00:00","og_image":[{"url":"https:\/\/wetransform.eu\/wp-content\/uploads\/2022\/05\/groovy-logo.png","type":"","width":"","height":""}],"twitter_card":"summary_large_image","twitter_site":"@wetransformto","twitter_misc":{"Gesch\u00e4tzte Lesezeit":"2\u00a0Minuten"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/wetransform.to\/de\/neuigkeiten-veranstaltungen\/groovy-week-free-scripts\/","url":"https:\/\/wetransform.to\/de\/neuigkeiten-veranstaltungen\/groovy-week-free-scripts\/","name":"It's Groovy Week: Free scripts for hale\u00bbstudio - wetransform","isPartOf":{"@id":"http:\/\/wetransform.to\/de\/#website"},"primaryImageOfPage":{"@id":"https:\/\/wetransform.to\/de\/neuigkeiten-veranstaltungen\/groovy-week-free-scripts\/#primaryimage"},"image":{"@id":"https:\/\/wetransform.to\/de\/neuigkeiten-veranstaltungen\/groovy-week-free-scripts\/#primaryimage"},"thumbnailUrl":"https:\/\/wetransform.eu\/wp-content\/uploads\/2022\/05\/groovy-logo.png","datePublished":"2018-06-25T15:11:44+00:00","dateModified":"2022-07-28T08:47:58+00:00","description":"hale\u00bbstudio offers more than out-of-the-box functionality. You can create your own transformation functions using Groovy scripts!","breadcrumb":{"@id":"https:\/\/wetransform.to\/de\/neuigkeiten-veranstaltungen\/groovy-week-free-scripts\/#breadcrumb"},"inLanguage":"de","potentialAction":[{"@type":"ReadAction","target":["https:\/\/wetransform.to\/de\/neuigkeiten-veranstaltungen\/groovy-week-free-scripts\/"]}]},{"@type":"ImageObject","inLanguage":"de","@id":"https:\/\/wetransform.to\/de\/neuigkeiten-veranstaltungen\/groovy-week-free-scripts\/#primaryimage","url":"https:\/\/wetransform.eu\/wp-content\/uploads\/2022\/05\/groovy-logo.png","contentUrl":"https:\/\/wetransform.eu\/wp-content\/uploads\/2022\/05\/groovy-logo.png"},{"@type":"BreadcrumbList","@id":"https:\/\/wetransform.to\/de\/neuigkeiten-veranstaltungen\/groovy-week-free-scripts\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/wetransform.to\/de\/"},{"@type":"ListItem","position":2,"name":"News & Events","item":"https:\/\/wetransform.to\/de\/neuigkeiten-veranstaltungen\/"},{"@type":"ListItem","position":3,"name":"It&#8217;s Groovy Week: Free scripts for hale\u00bbstudio"}]},{"@type":"WebSite","@id":"http:\/\/wetransform.to\/de\/#website","url":"http:\/\/wetransform.to\/de\/","name":"wetransform","description":"Making environmental data useful and accessible","publisher":{"@id":"http:\/\/wetransform.to\/de\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/wetransform.to\/de\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"de"},{"@type":"Organization","@id":"http:\/\/wetransform.to\/de\/#organization","name":"wetransform","url":"http:\/\/wetransform.to\/de\/","logo":{"@type":"ImageObject","inLanguage":"de","@id":"http:\/\/wetransform.to\/de\/#\/schema\/logo\/image\/","url":"https:\/\/wetransform.to\/wp-content\/uploads\/2022\/07\/large-logo-whitebg.png","contentUrl":"https:\/\/wetransform.to\/wp-content\/uploads\/2022\/07\/large-logo-whitebg.png","width":1024,"height":1024,"caption":"wetransform"},"image":{"@id":"http:\/\/wetransform.to\/de\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/wetransformto","https:\/\/www.linkedin.com\/company\/wetransform-gmbh\/"]}]}},"_links":{"self":[{"href":"https:\/\/wetransform.to\/de\/wp-json\/wp\/v2\/news-and-events\/1637","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wetransform.to\/de\/wp-json\/wp\/v2\/news-and-events"}],"about":[{"href":"https:\/\/wetransform.to\/de\/wp-json\/wp\/v2\/types\/news-and-events"}],"author":[{"embeddable":true,"href":"https:\/\/wetransform.to\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wetransform.to\/de\/wp-json\/wp\/v2\/comments?post=1637"}],"version-history":[{"count":4,"href":"https:\/\/wetransform.to\/de\/wp-json\/wp\/v2\/news-and-events\/1637\/revisions"}],"predecessor-version":[{"id":3779,"href":"https:\/\/wetransform.to\/de\/wp-json\/wp\/v2\/news-and-events\/1637\/revisions\/3779"}],"wp:attachment":[{"href":"https:\/\/wetransform.to\/de\/wp-json\/wp\/v2\/media?parent=1637"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wetransform.to\/de\/wp-json\/wp\/v2\/categories?post=1637"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wetransform.to\/de\/wp-json\/wp\/v2\/tags?post=1637"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}