BearGIS Plugin (GIS data reader / writer, shp, geojson)

welcome BearGIS

I’m posting to share a new grasshopper plugin I have been developing for extended GIS data support and interoperability. The big idea behand BearGIS is to enable export of geometry and accompanying attributes to GIS data formats.

The primary functionality has been implemented but it is not 100% complete. It is hosted on Github at the moment and will make its way to food4rhino after a bit more development and cleaning. If you are a developer and choose to look at the code… it’s messy. I will be cleaning things up and conforming to best practices once I wrap up implementing some additional functionality.

Current Highlights:

  • Write ESRI standard GeoJson files for easy interoperability with Arcmap and ArcGIS
  • Read ESRI GeoJson for easy import of data into rhino from ESRI platforms.
  • Read .SHP files into grasshopper (this is currently a bit slow and needs some work to speed up)

To Come:

  • Export standard GeoJson for easy web uploading
  • Import GeoJson - the more common geojson standard (Though I believe others have developed this already)
  • Export .SHP, preferable to Geojson for wider gis platform support

Check it out!

Plug-in Site: https://nicoazel.github.io/BearGIS/
Github Repository: https://github.com/nicoazel/BearGIS

UPDATE

New Features

  • SHP Writing from GH
  • Faster SHP Reader
  • Fixed Github Pages For Downloading Zip
  • Improved Attribute Type Handling

On The Horizon

  • Geojson Support
  • Food4rhino Upload
  • Example Files (Though Things Are Fairly Self Explanatory)

Plug-in Site: https://nicoazel.github.io/BearGIS/
Github Repository: https://github.com/nicoazel/BearGIS

Excellent plugin!

The shapefile export works perfectly. For who doesn’t know what to plug in the field “.prj File Path”, it’s the Coordinate System desired. To have that, you can:

Go in ArcMap > in Table of Contents, double click the “Layers” > Coordinate System > search the one that you wish, Right click > Save as…

This will make you have the .prj file.

And @Nicolas_Azel, just one observation: It would be interesting to control the field type, so you could choose between string, double, integer…

Congratulations for the plugin, again.

Thank you,
Kevin

An new update has been made to bearGIS’s .shp export functionality to support field types.

The current functionality for fields is to default to string unless specified within the fields input. To specify the desired type, follow the field name with a semicolon and the corresponding .net type.

Example:
myFieldName;System.Double will create a data column named ‘myFieldName’ of type ```double``

You can download the latest version here https://nicoazel.github.io/BearGIS/

Hi, It’s a wonderful plugin! can we have an example file?
I want to import a Geojasn to Grasshopper but it’s not successful.
I got the message:

  1. Solution exception:Object reference not set to an instance of an object.

I’ve attached a Zip below with the most recent version of the plugin and examples.
BearGIS Example.zip

Note that prior to this version BearGIS did not support GeoJson only ESRI formatted JSON. For alternative GeoJSON support in Grasshopper you may want to consider Decoding Spaces Plugin

See Example File Screen Captures Below:

Import

Export

Testing GIS Data Types

Posting that a new version has been pushed that includes more GeoJSON exporting tools and Projection tools for Points to Lat Lon as well as between two projection systems.

hi @Nicolas_Azel, Thks for Plugin. But I can not understand the “PRJ file path” and “Filepath” in this Component
so I have an issue with the image, can u help me? thank you!

Hi @theanhtran1996, the prj file sets the projection system for your export and the file path sets the destination for the .shp. Both are required for the export component.

It looks like the component is having a hard time finding your .prj file. Perhaps the file path is incorrect. From the image, it seems like you might be missing an extra back slash '' for your PRJ folder in the concatenation? Using the ‘File Path’ component to set an existing file may help to avoid typo’s in the file path.

@Nicolas_Azel
I’m having a problem where the PackageManager cannot automatically download BearGIS succesfully.


Can you repeat the problem? Steps to take:

  1. create an empty GH file
  2. Add the component PolylineSHP
  3. save the file
  4. uninstall BearGIS
  5. restart Rhino
  6. Open the GH file
  7. Try to install using the automatic process

Thank you for your interest in beargis. I’ve recently published a new version for Rhino 7 and Rhino 8. These are available on the package manager and through the projects github. These may solve some of the issues mentioned above.

Hi @Nicolas_Azel, I am quite interested in the export to .shp file functions you have developed. However, once I install and try to run the example script you provide, I do get the following error on the export component:

Solution exception:Could not load type ‘System.ICloneable’ from assembly ‘System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’.

Any ideas why this is happening?
I have installed latest version of BearGIS through PackageManager (Rhino 8).

Thanks!

Hi Thomas, I believe this may be related to which .NET runtime your rhino is targeting.

See some details here: Rhino - .NET Core vs .NET Framework

the latest version of BearGIS 2.1.1 targets .NET Core 8 - you can set this with the rhino command SetDotNetRuntime.

Older versions of BearGIS were built against .NET Framework - so you could try and see if an older version works for you if your committed to .Net Framework for other plugins.

Hi Nicolas,

Thank you for getting back with a reply to my issue.

I believe you are right about the .NET runtime. I was having issues with the .NET Framework vs .NET Core across various plugins, and in the end I needed a clean install of Rhino 8.

Now the BearGIS components does seem to run properly :slight_smile:

Thanks!