Import Data from a WFS-Service (CityGML)

Is there any way I can import vector data from a WFS-Service into Grasshopper? The WFS I would like to access responses in CityGML-Format. I haven´t found any CityGML-Importer so far :frowning:

1 Like

You can use the xml parser from ghowl.

and Heron Gdal ogr2ogr.

Where are you getting your CityGML from?

As Japhy points out AntFarm can import CityGML and it is possible to write a direct connection to a WFS Service. I would suggest that you try downloading the GML files first and importing them into AntFarm. If there is enough demand at a later date we could look to writing a connector.

1 Like

Hello any progress on a connector to a WFS-Service. Thanks!

Alternatively, if the service you are intrested in supports GeoJSON format, parsing the response into Rhino types is quite trivial using just ghPython without any additional modules. Here I made some examples of ghPython scripts connecting to and parsing responses from various WMS or WFS or custom geocoding APIs.

I’m not sure which specific WFS Api you want to access, but updating the URL, srs and typeName parameters at the begining of the WFS script should be enough to get you started.

WMS_WFS_Api_example.gh (29.8 KB)

Zkusil jsem tvuj script. Na chvili se ortophoto v Rhinu objevilo, ale po chvili zmizelo. Ted uz se nezobrazuje vubec. Nevis cim by to mohlo byt?

Works on my machine.

Zkusil jsem otevrit puvodni .gh definition - WFS uz nefunguje, ale ortophoto je porad v pohode.

Nezapomen ze ortophoto je dost daleko od Rhino coordinate origin pointu. Nejjednodussi zpusob to najit je oznacit “Custom Preview” component, kliknout pravym tlacitkem nekam na GH canvas a zvolit “Zoom”.

image

Ortho uz mi asi taky funguje. Jenom se mi to nezobrazuje v Rhinu, protoze ten “custom preview materials” v Grasshopperu nemam. To je z pluginu “Human”? Jsem zvykly pouzivat plugin Heron, ale pres Heron se mi dari nacitat pouze “REST Services” a u WMF a WFS nevim jak na to. Krom toho nerad stavim sve workflow na techto externich pluginech, protoze jejich zivotnost je casto pomerne omezena. Rad bych si v Python vytvoril vlastni nastroje podobne Heron. S programovanim v Python vsak nemam prakticky zadne zkusenosti, ale nevypada to slozite. Dokazal by si me nejak nasmerovat, nekam co by mi pomohlo s Pythnonerm zacit a naprogramovat si vlastni nastroje podobne Heron?

Hele, napíšu to anglicky, stejně se to budeš učit anglicky, a ostatní lidi no fóru z toho taky něco budou mít:

Good place to start are the McNeels tutorials for Python in Grasshopper.

But if you want to dig deeper and actually start developing something using geospatial data like the examples above, you should ideally cover:

  • Basics of Python - there’s so many resources, just pick one (eg. Learn Python the Hard Way, which still seems to be a good choice). But I would say it’s better to just start working on something you actually want to build as soon as you can, rather than wasting too much time on “training” exercises.

  • Having some overview of RhinoCommon - not a hard requirement, but its useful. Personally I prefer using RhinoCommon directly (import Rhino) over the scriptsyntax (import rhinoscriptsyntax as rs) and you will benefit from knowing it if you ever plan to switch to C#.

  • Basics of how GIS infrastructure works over the Web, mainly:

To je z pluginu “Human”?

Yes

Thanks a lot for the suggestions. That is exactly what I was looking for :slight_smile:

1 Like