├── .github └── workflows │ └── release.yml ├── .releaserc.json ├── LICENSE ├── README.md ├── README.txt ├── examples ├── 00_write_shp_file_with_fields │ ├── out │ │ └── out.txt │ └── write_shp_file_with_fields.gh ├── 01_write_shp_file_discretization │ ├── out │ │ └── out.txt │ └── write_shp_file_discretization.gh ├── 02_read_shp_file_extrude_buildings │ ├── read_shp_file_extrude_buildings.gh │ └── shp │ │ ├── polygon.dbf │ │ ├── polygon.prj │ │ ├── polygon.shp │ │ └── polygon.shx ├── 03_read_shp_extrude_building_empty_values │ ├── read_shp_extrude_building_empty_values.gh │ └── shp │ │ ├── multipolygons.dbf │ │ ├── multipolygons.prj │ │ ├── multipolygons.shp │ │ └── multipolygons.shx ├── 04_export_fields_to_excel │ ├── export_fields_to_excel.gh │ └── shp │ │ ├── multipolygons.dbf │ │ ├── multipolygons.prj │ │ ├── multipolygons.shp │ │ └── multipolygons.shx ├── 05_write_shp_file_mesh │ ├── out │ │ └── out.txt │ └── write_shp_file_mesh.gh ├── 06_write_raster_file │ ├── out │ │ └── out.txt │ ├── shp │ │ ├── polygon.dbf │ │ ├── polygon.prj │ │ ├── polygon.shp │ │ └── polygon.shx │ └── write_raster_file.gh ├── 07_write_raster_file_from_img │ ├── img │ │ └── voronoi.png │ ├── out │ │ └── out.txt │ └── write_raster_file_from_img.gh ├── 08_write_shp_with_z_values_reference_altitude │ ├── out │ │ └── out.txt │ └── write_shp_with_z_values_reference_altitude.gh ├── 09_write_shp_with_z_values │ ├── out │ │ └── out.txt │ └── write_shp_with_z_values.gh ├── 10_read_geojson_features │ ├── geojson │ │ └── scmpd-precinct-polygons.geojson │ └── read_geojson_features.gh ├── 11_write_geojson_file_with_fields │ ├── out │ │ └── out.txt │ └── write_geojson_file_with_fields.gh ├── 12_write_geojson_with_multiplegeometry │ ├── out │ │ └── out.txt │ └── write_geojson_with_multigeometry.gh ├── 13_write_geojson_with_many_types_by_merge │ ├── out │ │ └── out.txt │ └── write_geojson_with_many_types_by_merge.gh ├── 14_write_geojson_with_many_types │ ├── out │ │ └── out.txt │ └── write_geojson_with_many_types.gh ├── 15_from_lbt_to_shp │ ├── from_lbt_to_shp.gh │ ├── out │ │ ├── polygon.dbf │ │ ├── polygon.prj │ │ ├── polygon.shp │ │ └── polygon.shx │ └── wind_rose.PNG ├── ShrimpGIS_milan_top.png ├── ShrimpGIS_vesuvius_plus_gismo_qgis_threejs.png ├── shrimp_gis.gif ├── shrimp_gis_from_img_to_gis.gif ├── shrimp_gis_mesh.gif └── shrimp_gis_raster.PNG ├── install_lib.gh ├── lib └── shrimp_gis │ ├── __init__.py │ ├── field.py │ ├── geometry │ ├── __init__.py │ ├── base.py │ ├── curve.py │ ├── curvez.py │ ├── matrix.py │ ├── mesh.py │ ├── multiGeometry.py │ ├── point.py │ ├── pointz.py │ ├── polygon.py │ └── polygonz.py │ ├── io │ ├── __init__.py │ ├── pygeoj.py │ ├── query.py │ ├── read.py │ ├── shapefile.py │ ├── shapefiles │ │ ├── blockgroups.dbf │ │ ├── blockgroups.sbn │ │ ├── blockgroups.sbx │ │ ├── blockgroups.shp │ │ ├── blockgroups.shx │ │ └── test │ │ │ ├── MyPolyZ.dbf │ │ │ ├── MyPolyZ.shp │ │ │ ├── MyPolyZ.shx │ │ │ ├── NullTest.dbf │ │ │ ├── NullTest.shp │ │ │ ├── NullTest.shx │ │ │ ├── balancing.dbf │ │ │ ├── balancing.shp │ │ │ ├── balancing.shx │ │ │ ├── contextwriter.dbf │ │ │ ├── contextwriter.shp │ │ │ ├── contextwriter.shx │ │ │ ├── dtype.dbf │ │ │ ├── dtype.shp │ │ │ ├── dtype.shx │ │ │ ├── latin1.dbf │ │ │ ├── latin1.shp │ │ │ ├── line.dbf │ │ │ ├── line.shp │ │ │ ├── line.shx │ │ │ ├── linem.dbf │ │ │ ├── linem.shp │ │ │ ├── linem.shx │ │ │ ├── linez.dbf │ │ │ ├── linez.shp │ │ │ ├── linez.shx │ │ │ ├── multipatch.dbf │ │ │ ├── multipatch.shp │ │ │ ├── multipatch.shx │ │ │ ├── multipoint.dbf │ │ │ ├── multipoint.shp │ │ │ ├── multipoint.shx │ │ │ ├── onlydbf.dbf │ │ │ ├── point.dbf │ │ │ ├── point.shp │ │ │ ├── point.shx │ │ │ ├── polygon.dbf │ │ │ ├── polygon.shp │ │ │ ├── polygon.shx │ │ │ ├── shapetype.dbf │ │ │ ├── shapetype.shp │ │ │ ├── shapetype.shx │ │ │ ├── testfile.dbf │ │ │ ├── testfile.shp │ │ │ └── testfile.shx │ ├── transformation.py │ └── write.py │ ├── lic │ ├── pygeo_license.txt │ ├── shapefiles_license.txt │ └── utm_license.txt │ ├── location.py │ ├── scripts │ └── utm-converter │ └── utm │ ├── __init__.py │ ├── conversion.py │ └── error.py ├── resources ├── lb_shrimpgis_threejs_qgis │ ├── Qgis2threejs.css │ ├── Qgis2threejs.js │ ├── Qgis2threejs.png │ ├── data │ │ └── index │ │ │ ├── a0.json │ │ │ ├── a1.json │ │ │ ├── a10.json │ │ │ ├── a11.json │ │ │ ├── a12.json │ │ │ ├── a13.json │ │ │ ├── a14.json │ │ │ ├── a15.json │ │ │ ├── a16.json │ │ │ ├── a17.json │ │ │ ├── a18.json │ │ │ ├── a19.json │ │ │ ├── a2.json │ │ │ ├── a20.json │ │ │ ├── a21.json │ │ │ ├── a22.json │ │ │ ├── a23.json │ │ │ ├── a24.json │ │ │ ├── a25.json │ │ │ ├── a26.json │ │ │ ├── a27.json │ │ │ ├── a28.json │ │ │ ├── a29.json │ │ │ ├── a3.json │ │ │ ├── a30.json │ │ │ ├── a31.json │ │ │ ├── a32.json │ │ │ ├── a33.json │ │ │ ├── a34.json │ │ │ ├── a35.json │ │ │ ├── a36.json │ │ │ ├── a37.json │ │ │ ├── a38.json │ │ │ ├── a39.json │ │ │ ├── a4.json │ │ │ ├── a40.json │ │ │ ├── a41.json │ │ │ ├── a42.json │ │ │ ├── a43.json │ │ │ ├── a44.json │ │ │ ├── a45.json │ │ │ ├── a46.json │ │ │ ├── a47.json │ │ │ ├── a48.json │ │ │ ├── a49.json │ │ │ ├── a5.json │ │ │ ├── a50.json │ │ │ ├── a51.json │ │ │ ├── a52.json │ │ │ ├── a53.json │ │ │ ├── a54.json │ │ │ ├── a55.json │ │ │ ├── a56.json │ │ │ ├── a57.json │ │ │ ├── a58.json │ │ │ ├── a59.json │ │ │ ├── a6.json │ │ │ ├── a60.json │ │ │ ├── a61.json │ │ │ ├── a62.json │ │ │ ├── a63.json │ │ │ ├── a64.json │ │ │ ├── a65.json │ │ │ ├── a7.json │ │ │ ├── a8.json │ │ │ ├── a9.json │ │ │ ├── b0.bin │ │ │ ├── b0.png │ │ │ └── scene.json │ ├── index.html │ └── threejs │ │ ├── LICENSE │ │ ├── OrbitControls.js │ │ └── three.min.js ├── shrimp_gis_logo.png └── wiki_img │ └── 1_1_qgis.gif ├── src ├── ShrimpGIS Curve.py ├── ShrimpGIS CurveZ.py ├── ShrimpGIS Decompose Field.py ├── ShrimpGIS Esri ASCII.py ├── ShrimpGIS Field.py ├── ShrimpGIS Get UTM.py ├── ShrimpGIS Location.py ├── ShrimpGIS Merge Geojson.py ├── ShrimpGIS Mesh.py ├── ShrimpGIS Multigeometry.py ├── ShrimpGIS Null List.py ├── ShrimpGIS Point.py ├── ShrimpGIS PointZ.py ├── ShrimpGIS Polygon.py ├── ShrimpGIS PolygonZ.py ├── ShrimpGIS Read Geojson.py ├── ShrimpGIS Read Shp.py ├── ShrimpGIS UTM PRJ.py ├── ShrimpGIS Write Asc.py ├── ShrimpGIS Write Geojson.py └── ShrimpGIS Write Shp.py └── user_objects ├── ShrimpGIS Curve.ghuser ├── ShrimpGIS CurveZ.ghuser ├── ShrimpGIS Decompose Field.ghuser ├── ShrimpGIS Esri ASCII.ghuser ├── ShrimpGIS Field.ghuser ├── ShrimpGIS Get UTM.ghuser ├── ShrimpGIS Location.ghuser ├── ShrimpGIS Merge Geojson.ghuser ├── ShrimpGIS Mesh.ghuser ├── ShrimpGIS MultiGeometry.ghuser ├── ShrimpGIS Null List.ghuser ├── ShrimpGIS Point.ghuser ├── ShrimpGIS PointZ.ghuser ├── ShrimpGIS Polygon.ghuser ├── ShrimpGIS PolygonZ.ghuser ├── ShrimpGIS Read Geojson.ghuser ├── ShrimpGIS Read Shp.ghuser ├── ShrimpGIS UTM PRJ.ghuser ├── ShrimpGIS Write Asc.ghuser ├── ShrimpGIS Write Geojson.ghuser └── ShrimpGIS Write Shp.ghuser /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: CD 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | paths-ignore: 7 | - '**/README.txt' 8 | - '**/README.md' 9 | 10 | pull_request: 11 | branches: [ master ] 12 | paths-ignore: 13 | - '**/README.txt' 14 | - '**/README.md' 15 | 16 | jobs: 17 | build: 18 | name: Build and release Morpho 19 | runs-on: windows-latest 20 | 21 | steps: 22 | - name: Checkout master branch 23 | uses: actions/checkout@v2 24 | with: 25 | token: ${{ secrets.GH_TOKEN }} 26 | submodules: true 27 | 28 | - name: zip folder 29 | run: | 30 | echo "New folder" 31 | New-Item .\deploy -Type Directory 32 | echo "Copy folders and files" 33 | Copy-Item -Path (".\examples", ".\user_objects", ".\lib", ".\LICENSE", "README.txt", ".\install_lib.gh") -Destination .\deploy -Recurse 34 | echo "Create zip file" 35 | Compress-Archive -Path .\deploy\* -DestinationPath shrimp_gis.zip 36 | echo "Remove deploy" 37 | Remove-Item -LiteralPath .\deploy -Force -Recurse 38 | 39 | - uses: actions/setup-node@v2 40 | with: 41 | node-version: 14 42 | 43 | - name: Semantic release 44 | uses: cycjimmy/semantic-release-action@v3 45 | id: semantic 46 | env: 47 | GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} 48 | -------------------------------------------------------------------------------- /.releaserc.json: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": [ 3 | "@semantic-release/commit-analyzer", 4 | "@semantic-release/release-notes-generator", 5 | [ 6 | "@semantic-release/github", 7 | { 8 | "assets": [ 9 | { 10 | "path": "shrimp_gis.zip", 11 | "name": "shrimp_gis-${nextRelease.version}.zip", 12 | "label": "shrimp_gis-${nextRelease.version}.zip" 13 | } 14 | ] 15 | } 16 | ] 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ShrimpGIS 2 | ![Logo](https://github.com/AntonelloDN/ShrimpGIS/blob/master/resources/shrimp_gis_logo.png) 3 | A basic plugin for Grasshopper to read and write shapefile. Read more on [Wiki](https://github.com/AntonelloDN/ShrimpGIS/wiki) pages. 4 | You can use it with other plugins, [example](https://antonellodn.github.io/ShrimpGIS/) 5 | 6 | ![Alt Text](https://github.com/AntonelloDN/ShrimpGIS/blob/master/examples/ShrimpGIS_milan_top.png) 7 | 8 | [![Github All Releases](https://img.shields.io/github/downloads/AntonelloDN/ShrimpGIS/total.svg?color=white&label=release%20downloads)]() 9 | 10 | ### Easy to use! 11 | ![Alt Text](https://github.com/AntonelloDN/ShrimpGIS/blob/master/examples/shrimp_gis.gif) 12 | ![Alt Text](https://github.com/AntonelloDN/ShrimpGIS/blob/master/examples/shrimp_gis_mesh.gif) 13 | ![Alt Text](https://github.com/AntonelloDN/ShrimpGIS/blob/master/examples/shrimp_gis_from_img_to_gis.gif) 14 | ## Installation: 15 | 1. Download ShrimpGIS. Available on [Food4Rhino](https://www.food4rhino.com/app/shrimpgis) 16 | 2. Check if downloaded .zip file has been blocked: right click on it, and choose Properties. If there is an Unblock button click on it, otherwise it is OK. Unzip it. 17 | 3. Follow 'README.txt' instructions. 18 | ## Requirements: 19 | * Rhino 6 20 | ## Dependencies: 21 | * pyshp 22 | * utm 23 | * pygeoj 24 | ## Features: 25 | * Transformation of points, surface/breps, curves, meshes into Esri shapefile entities. 26 | * Discretization for curves and surface/breps. 27 | * Transformation of Esri shapefile entities into points, surface/breps, curves. 28 | * Extraction of fields. 29 | * Transformation of points, surface/breps, curves into Geojson entities. 30 | * Transformation of Geojson entities into points, surface/breps, curves. 31 | * Merge Multiple geojson in to one geojson 32 | * Write Esri ASCII Raster file. 33 | ## Limits v.1.0.3: 34 | * Rhino document has to be in meter 35 | * Only WGS84 (EPSG:4326) reference system is supported. I suggest you use a GIS software for reprojection (e.g. [QGIS](https://www.qgis.org/en/site/)). 36 | * Shapefile read component supports following GIS types: 37 | * POINT 38 | * POLYLINE 39 | * POLYGON 40 | * POINTZ 41 | * POLYLINEZ 42 | * POLYGONZ 43 | * Geojson components support only 2D FeatureCollection. 44 | ## Videos: 45 | [Showcase](https://youtu.be/UY8ezRylcj4) 46 | ## Contributors(a-z): 47 | * [Antonello Di Nunzio](https://github.com/AntonelloDN) 48 | ### Logo source 49 | Logo is a combination of icons of two designer: [hk12215](https://www.iconfinder.com/hk12215) [strokeicon](https://www.iconfinder.com/strokeicon) 50 | 51 | 52 | -------------------------------------------------------------------------------- /README.txt: -------------------------------------------------------------------------------- 1 | IF YOU HAVE A PREVIOUS VERSION OF SHRIMPGIS: 2 | 1. Go to %appdata% and go to Grasshopper/UserObjects 3 | 2. Delete all ShrimpGIS components 4 | 5 | INSTALLATION: 6 | 1. double click on 'install_lib.gh' to run it. 7 | 2. set install component to 'True' 8 | 3. drag and drop all component (*.ghuser) that are in 'user_objects' folder into Grasshopper canvas 9 | 4. restart Rhino and Grasshopper 10 | -------------------------------------------------------------------------------- /examples/00_write_shp_file_with_fields/out/out.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/examples/00_write_shp_file_with_fields/out/out.txt -------------------------------------------------------------------------------- /examples/00_write_shp_file_with_fields/write_shp_file_with_fields.gh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/examples/00_write_shp_file_with_fields/write_shp_file_with_fields.gh -------------------------------------------------------------------------------- /examples/01_write_shp_file_discretization/out/out.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/examples/01_write_shp_file_discretization/out/out.txt -------------------------------------------------------------------------------- /examples/01_write_shp_file_discretization/write_shp_file_discretization.gh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/examples/01_write_shp_file_discretization/write_shp_file_discretization.gh -------------------------------------------------------------------------------- /examples/02_read_shp_file_extrude_buildings/read_shp_file_extrude_buildings.gh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/examples/02_read_shp_file_extrude_buildings/read_shp_file_extrude_buildings.gh -------------------------------------------------------------------------------- /examples/02_read_shp_file_extrude_buildings/shp/polygon.dbf: -------------------------------------------------------------------------------- 1 | xA)heightF( 101.00 39.00 20.00 183.00 152.00 39.00 90.00 86.00 180.00 164.00 56.00 142.00 155.00 115.00 35.00 145.00 45.00 4.00 5.00 4.00 6.00 5.00 5.00 5.00 5.00 14.00 14.00 14.00 14.00 14.00 14.00 14.00 14.00 14.00 14.00 14.00 20.00 14.00 14.00 14.00 14.00 14.00 14.00 14.00 14.00 14.00 14.00 14.00 14.00 14.00 15.00 25.00 32.00 8.00 40.00 15.00 30.00 190.00 56.00 20.00 20.00 32.00 16.00 8.00 16.00 8.00 16.00 30.00 25.00 30.00 183.00 16.00 183.00 14.00 8.00 20.00 20.00 35.00 35.00 100.00 15.00 23.00 38.00 30.00 45.00 25.00 15.00 122.00 119.00 121.50 18.00 18.00 18.00 133.00 117.00 155.00 143.00 155.00 164.00 110.00 110.00 110.00 118.90 70.00 70.00 40.00 70.00 40.00 40.00 70.00 70.00 70.00 40.00 70.00 70.00 70.00 70.00 70.00 70.00 70.00 70.00 70.00 70.00 40.00 70.00 100.00 70.00 100.00 100.00 70.00 100.00 100.00 100.00 70.00 40.00 100.00 100.00 110.00 50.00 50.00 140.00 140.00 156.00 140.00 140.00 150.00 145.00 140.00 156.00 160.00 160.00 160.00 160.00 160.00 160.00 160.00 140.00 156.00 148.00 24.00 54.00 52.00 96.00 118.00 105.00 20.00 23.00 23.00 21.00 21.00 21.00 21.00 52.00 40.00 19.00 19.00 41.00 41.00 41.00 41.00 32.00 66.00 46.00 18.00 145.00 25.00 150.00 148.00 140.00 107.00 143.00 117.00 133.00 32.00 18.00 35.00 35.00 3.50 36.00 32.50 4.00 32.00 19.00 3.20 4.00 18.10 20.00 32.00 12.00 12.00 12.00 12.00 12.00 12.00 3.50 12.00 18.00 13.00 14.00 159.00 122.00 119.00 119.00 112.00 112.00 119.00 112.00 112.00 112.00 119.00 112.00 119.00 112.00 112.00 119.00 119.00 119.00 112.00 112.00 112.00 119.00 112.00 119.00 119.00 118.00 112.00 119.00 112.00 112.00 119.00 119.00 112.00 119.00 112.00 112.00 112.00 112.00 112.00 119.00 119.00 112.00 119.00 112.00 119.00 119.00 119.00 112.00 119.00 119.00 119.00 119.00 39.00 39.00 18.00 12.00 49.00 105.00 -------------------------------------------------------------------------------- /examples/02_read_shp_file_extrude_buildings/shp/polygon.prj: -------------------------------------------------------------------------------- 1 | GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]] -------------------------------------------------------------------------------- /examples/02_read_shp_file_extrude_buildings/shp/polygon.shp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/examples/02_read_shp_file_extrude_buildings/shp/polygon.shp -------------------------------------------------------------------------------- /examples/02_read_shp_file_extrude_buildings/shp/polygon.shx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/examples/02_read_shp_file_extrude_buildings/shp/polygon.shx -------------------------------------------------------------------------------- /examples/03_read_shp_extrude_building_empty_values/read_shp_extrude_building_empty_values.gh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/examples/03_read_shp_extrude_building_empty_values/read_shp_extrude_building_empty_values.gh -------------------------------------------------------------------------------- /examples/03_read_shp_extrude_building_empty_values/shp/multipolygons.dbf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/examples/03_read_shp_extrude_building_empty_values/shp/multipolygons.dbf -------------------------------------------------------------------------------- /examples/03_read_shp_extrude_building_empty_values/shp/multipolygons.prj: -------------------------------------------------------------------------------- 1 | GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]] -------------------------------------------------------------------------------- /examples/03_read_shp_extrude_building_empty_values/shp/multipolygons.shp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/examples/03_read_shp_extrude_building_empty_values/shp/multipolygons.shp -------------------------------------------------------------------------------- /examples/03_read_shp_extrude_building_empty_values/shp/multipolygons.shx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/examples/03_read_shp_extrude_building_empty_values/shp/multipolygons.shx -------------------------------------------------------------------------------- /examples/04_export_fields_to_excel/export_fields_to_excel.gh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/examples/04_export_fields_to_excel/export_fields_to_excel.gh -------------------------------------------------------------------------------- /examples/04_export_fields_to_excel/shp/multipolygons.dbf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/examples/04_export_fields_to_excel/shp/multipolygons.dbf -------------------------------------------------------------------------------- /examples/04_export_fields_to_excel/shp/multipolygons.prj: -------------------------------------------------------------------------------- 1 | GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]] -------------------------------------------------------------------------------- /examples/04_export_fields_to_excel/shp/multipolygons.shp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/examples/04_export_fields_to_excel/shp/multipolygons.shp -------------------------------------------------------------------------------- /examples/04_export_fields_to_excel/shp/multipolygons.shx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/examples/04_export_fields_to_excel/shp/multipolygons.shx -------------------------------------------------------------------------------- /examples/05_write_shp_file_mesh/out/out.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/examples/05_write_shp_file_mesh/out/out.txt -------------------------------------------------------------------------------- /examples/05_write_shp_file_mesh/write_shp_file_mesh.gh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/examples/05_write_shp_file_mesh/write_shp_file_mesh.gh -------------------------------------------------------------------------------- /examples/06_write_raster_file/out/out.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/examples/06_write_raster_file/out/out.txt -------------------------------------------------------------------------------- /examples/06_write_raster_file/shp/polygon.dbf: -------------------------------------------------------------------------------- 1 | xA)heightF( 101.00 39.00 20.00 183.00 152.00 39.00 90.00 86.00 180.00 164.00 56.00 142.00 155.00 115.00 35.00 145.00 45.00 4.00 5.00 4.00 6.00 5.00 5.00 5.00 5.00 14.00 14.00 14.00 14.00 14.00 14.00 14.00 14.00 14.00 14.00 14.00 20.00 14.00 14.00 14.00 14.00 14.00 14.00 14.00 14.00 14.00 14.00 14.00 14.00 14.00 15.00 25.00 32.00 8.00 40.00 15.00 30.00 190.00 56.00 20.00 20.00 32.00 16.00 8.00 16.00 8.00 16.00 30.00 25.00 30.00 183.00 16.00 183.00 14.00 8.00 20.00 20.00 35.00 35.00 100.00 15.00 23.00 38.00 30.00 45.00 25.00 15.00 122.00 119.00 121.50 18.00 18.00 18.00 133.00 117.00 155.00 143.00 155.00 164.00 110.00 110.00 110.00 118.90 70.00 70.00 40.00 70.00 40.00 40.00 70.00 70.00 70.00 40.00 70.00 70.00 70.00 70.00 70.00 70.00 70.00 70.00 70.00 70.00 40.00 70.00 100.00 70.00 100.00 100.00 70.00 100.00 100.00 100.00 70.00 40.00 100.00 100.00 110.00 50.00 50.00 140.00 140.00 156.00 140.00 140.00 150.00 145.00 140.00 156.00 160.00 160.00 160.00 160.00 160.00 160.00 160.00 140.00 156.00 148.00 24.00 54.00 52.00 96.00 118.00 105.00 20.00 23.00 23.00 21.00 21.00 21.00 21.00 52.00 40.00 19.00 19.00 41.00 41.00 41.00 41.00 32.00 66.00 46.00 18.00 145.00 25.00 150.00 148.00 140.00 107.00 143.00 117.00 133.00 32.00 18.00 35.00 35.00 3.50 36.00 32.50 4.00 32.00 19.00 3.20 4.00 18.10 20.00 32.00 12.00 12.00 12.00 12.00 12.00 12.00 3.50 12.00 18.00 13.00 14.00 159.00 122.00 119.00 119.00 112.00 112.00 119.00 112.00 112.00 112.00 119.00 112.00 119.00 112.00 112.00 119.00 119.00 119.00 112.00 112.00 112.00 119.00 112.00 119.00 119.00 118.00 112.00 119.00 112.00 112.00 119.00 119.00 112.00 119.00 112.00 112.00 112.00 112.00 112.00 119.00 119.00 112.00 119.00 112.00 119.00 119.00 119.00 112.00 119.00 119.00 119.00 119.00 39.00 39.00 18.00 12.00 49.00 105.00 -------------------------------------------------------------------------------- /examples/06_write_raster_file/shp/polygon.prj: -------------------------------------------------------------------------------- 1 | GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]] -------------------------------------------------------------------------------- /examples/06_write_raster_file/shp/polygon.shp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/examples/06_write_raster_file/shp/polygon.shp -------------------------------------------------------------------------------- /examples/06_write_raster_file/shp/polygon.shx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/examples/06_write_raster_file/shp/polygon.shx -------------------------------------------------------------------------------- /examples/06_write_raster_file/write_raster_file.gh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/examples/06_write_raster_file/write_raster_file.gh -------------------------------------------------------------------------------- /examples/07_write_raster_file_from_img/img/voronoi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/examples/07_write_raster_file_from_img/img/voronoi.png -------------------------------------------------------------------------------- /examples/07_write_raster_file_from_img/out/out.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/examples/07_write_raster_file_from_img/out/out.txt -------------------------------------------------------------------------------- /examples/07_write_raster_file_from_img/write_raster_file_from_img.gh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/examples/07_write_raster_file_from_img/write_raster_file_from_img.gh -------------------------------------------------------------------------------- /examples/08_write_shp_with_z_values_reference_altitude/out/out.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/examples/08_write_shp_with_z_values_reference_altitude/out/out.txt -------------------------------------------------------------------------------- /examples/08_write_shp_with_z_values_reference_altitude/write_shp_with_z_values_reference_altitude.gh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/examples/08_write_shp_with_z_values_reference_altitude/write_shp_with_z_values_reference_altitude.gh -------------------------------------------------------------------------------- /examples/09_write_shp_with_z_values/out/out.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/examples/09_write_shp_with_z_values/out/out.txt -------------------------------------------------------------------------------- /examples/09_write_shp_with_z_values/write_shp_with_z_values.gh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/examples/09_write_shp_with_z_values/write_shp_with_z_values.gh -------------------------------------------------------------------------------- /examples/10_read_geojson_features/read_geojson_features.gh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/examples/10_read_geojson_features/read_geojson_features.gh -------------------------------------------------------------------------------- /examples/11_write_geojson_file_with_fields/out/out.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/examples/11_write_geojson_file_with_fields/out/out.txt -------------------------------------------------------------------------------- /examples/11_write_geojson_file_with_fields/write_geojson_file_with_fields.gh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/examples/11_write_geojson_file_with_fields/write_geojson_file_with_fields.gh -------------------------------------------------------------------------------- /examples/12_write_geojson_with_multiplegeometry/out/out.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/examples/12_write_geojson_with_multiplegeometry/out/out.txt -------------------------------------------------------------------------------- /examples/12_write_geojson_with_multiplegeometry/write_geojson_with_multigeometry.gh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/examples/12_write_geojson_with_multiplegeometry/write_geojson_with_multigeometry.gh -------------------------------------------------------------------------------- /examples/13_write_geojson_with_many_types_by_merge/out/out.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/examples/13_write_geojson_with_many_types_by_merge/out/out.txt -------------------------------------------------------------------------------- /examples/13_write_geojson_with_many_types_by_merge/write_geojson_with_many_types_by_merge.gh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/examples/13_write_geojson_with_many_types_by_merge/write_geojson_with_many_types_by_merge.gh -------------------------------------------------------------------------------- /examples/14_write_geojson_with_many_types/out/out.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/examples/14_write_geojson_with_many_types/out/out.txt -------------------------------------------------------------------------------- /examples/14_write_geojson_with_many_types/write_geojson_with_many_types.gh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/examples/14_write_geojson_with_many_types/write_geojson_with_many_types.gh -------------------------------------------------------------------------------- /examples/15_from_lbt_to_shp/from_lbt_to_shp.gh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/examples/15_from_lbt_to_shp/from_lbt_to_shp.gh -------------------------------------------------------------------------------- /examples/15_from_lbt_to_shp/out/polygon.dbf: -------------------------------------------------------------------------------- 1 | x aQfrequencyF(evg_valF( 396.0000 5.8485 468.0000 6.0128 440.0000 6.0614 463.0000 5.6998 469.0000 6.0576 448.0000 5.9263 452.0000 5.7102 441.0000 5.8163 466.0000 5.7790 448.0000 6.2098 482.0000 5.7801 470.0000 5.5574 477.0000 5.5807 297.0000 5.9731 329.0000 5.9453 331.0000 5.7251 -------------------------------------------------------------------------------- /examples/15_from_lbt_to_shp/out/polygon.prj: -------------------------------------------------------------------------------- 1 | GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]] -------------------------------------------------------------------------------- /examples/15_from_lbt_to_shp/out/polygon.shp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/examples/15_from_lbt_to_shp/out/polygon.shp -------------------------------------------------------------------------------- /examples/15_from_lbt_to_shp/out/polygon.shx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/examples/15_from_lbt_to_shp/out/polygon.shx -------------------------------------------------------------------------------- /examples/15_from_lbt_to_shp/wind_rose.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/examples/15_from_lbt_to_shp/wind_rose.PNG -------------------------------------------------------------------------------- /examples/ShrimpGIS_milan_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/examples/ShrimpGIS_milan_top.png -------------------------------------------------------------------------------- /examples/ShrimpGIS_vesuvius_plus_gismo_qgis_threejs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/examples/ShrimpGIS_vesuvius_plus_gismo_qgis_threejs.png -------------------------------------------------------------------------------- /examples/shrimp_gis.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/examples/shrimp_gis.gif -------------------------------------------------------------------------------- /examples/shrimp_gis_from_img_to_gis.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/examples/shrimp_gis_from_img_to_gis.gif -------------------------------------------------------------------------------- /examples/shrimp_gis_mesh.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/examples/shrimp_gis_mesh.gif -------------------------------------------------------------------------------- /examples/shrimp_gis_raster.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/examples/shrimp_gis_raster.PNG -------------------------------------------------------------------------------- /install_lib.gh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/install_lib.gh -------------------------------------------------------------------------------- /lib/shrimp_gis/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | """ 5 | ShrimpGIS - Basic Grasshopper plugin to read and write shapefile. 6 | It uses: utm 0.5.0; pyshp 2.1.0; pygeoj 1.0.0 7 | """ 8 | 9 | # modules 10 | import geometry 11 | import io 12 | import utm 13 | from field import Field 14 | from location import Location 15 | 16 | __author__ = 'antonellodinunzio@gmail.com' 17 | __copyright__ = 'Antonello Di Nunzio' 18 | __credits__ = 'Antonello Di Nunzio' 19 | __license__ = 'GNU GPL V.3+' 20 | __version__ = '1.0.4' 21 | __maintainer__ = 'Antonello Di Nunzio' 22 | __email__ = 'plugin@antonellodinunzio.com' 23 | __status__ = 'release' 24 | -------------------------------------------------------------------------------- /lib/shrimp_gis/field.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | """Shape field.""" 3 | 4 | 5 | class Field(object): 6 | 7 | types = {0: 'C', 1: 'N', 2: 'F', 3: 'L', 4: 'D', 5: 'M'} 8 | 9 | def __init__(self, values, name ='TAG', type = 'C', length = 40, decimal = 0): 10 | self.__name = name 11 | self.values = values 12 | self.type = type 13 | self.length = length 14 | self.decimal = decimal 15 | 16 | @property 17 | def name(self): 18 | return self.__name 19 | 20 | @name.setter 21 | def name(self, value): 22 | """ 10 char limit """ 23 | self.__name = value 24 | if (len(value) > 10): 25 | self.__name = value[:10] 26 | 27 | @classmethod 28 | def get_type(cls, index): 29 | return cls.types[index] 30 | 31 | def ToString(self): 32 | return 'ShrimpGIS::field::{}'.format(self.name) 33 | -------------------------------------------------------------------------------- /lib/shrimp_gis/geometry/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from point import ShpPoint 3 | from curve import ShpCurve 4 | from polygon import ShpPolygon 5 | from mesh import ShpMesh 6 | from matrix import Matrix 7 | from pointz import ShpPointZ 8 | from curvez import ShpCurveZ 9 | from polygonz import ShpPolygonZ 10 | # for json only 11 | from multiGeometry import MultiGeometry -------------------------------------------------------------------------------- /lib/shrimp_gis/geometry/base.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | """Base Geometry.""" 3 | 4 | 5 | class ShpGeometry(object): 6 | 7 | def __init__(self, geometry): 8 | self.geometry = geometry 9 | self.coordinates = None 10 | 11 | def decompose_shp_geometry(self): 12 | return self.coordinates 13 | -------------------------------------------------------------------------------- /lib/shrimp_gis/geometry/curve.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | """Rhino Curve for GIS.""" 3 | 4 | from base import ShpGeometry 5 | import Rhino 6 | 7 | 8 | class ShpCurve(ShpGeometry): 9 | 10 | def __init__(self, geometry, number_of_division): 11 | ShpGeometry.__init__(self, geometry) 12 | self.name = "curve" 13 | self.points = self.get_points(geometry, number_of_division) 14 | 15 | @classmethod 16 | def get_points(cls, geometry, number_of_division): 17 | """Number of minimum points: 2""" 18 | if number_of_division < 2: number_of_division = 2 19 | 20 | if (geometry.IsPolyline()): 21 | geometry = geometry.ToNurbsCurve() 22 | points = [pt.Location for pt in geometry.Points] 23 | else: 24 | param = geometry.DivideByCount(number_of_division, True) 25 | points = [geometry.PointAt(t) for t in param] 26 | if geometry.IsClosed: 27 | points.append(points[0]) 28 | return points 29 | 30 | def ToString(self): 31 | return 'ShrimpGIS::curve::{}'.format(len(self.coordinates)) 32 | -------------------------------------------------------------------------------- /lib/shrimp_gis/geometry/curvez.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | """Rhino Curve Z for GIS.""" 3 | 4 | from curve import ShpCurve 5 | 6 | class ShpCurveZ(ShpCurve): 7 | 8 | def __init__(self, geometry, number_of_division): 9 | ShpCurve.__init__(self, geometry, number_of_division) 10 | self.name = "curveZ" 11 | 12 | def ToString(self): 13 | return 'ShrimpGIS::curveZ::{}'.format(len(self.coordinates)) 14 | -------------------------------------------------------------------------------- /lib/shrimp_gis/geometry/matrix.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | """ASCII matrix from values. Order of values: left-right bottom-top""" 3 | 4 | class Matrix(object): 5 | 6 | def __init__(self, values, num_x, num_y): 7 | 8 | self.values = values 9 | self.num_x = num_x 10 | self.num_y = num_y 11 | self.ASCII_matrix = self.__create_ASCII_matrix() 12 | 13 | 14 | def __create_ASCII_matrix(self): 15 | 16 | if (len(self.values) != self.num_x * self.num_y): 17 | raise Exception("Length of values have to be {0}.".format(self.num_x * self.num_y)) 18 | 19 | nested_grid = [] 20 | for i in range(0, len(self.values), self.num_x): 21 | chunck = self.values[i : i + self.num_x] 22 | nested_grid.append(chunck) 23 | 24 | matrix = [] 25 | for j in range(self.num_y-1, -1, -1): 26 | line = [] 27 | for i in range(self.num_x): 28 | line.append(str(nested_grid[j][i])) 29 | text = ' '.join(line) 30 | matrix.append(text) 31 | 32 | return '\n'.join(matrix) 33 | 34 | 35 | def ToString(self): 36 | return 'ShrimpGIS::ASCII::{}'.format(len(self.values)) -------------------------------------------------------------------------------- /lib/shrimp_gis/geometry/mesh.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | """Rhino Mesh for GIS.""" 3 | 4 | from base import ShpGeometry 5 | import Rhino 6 | 7 | 8 | class ShpMesh(ShpGeometry): 9 | 10 | def __init__(self, geometry): 11 | ShpGeometry.__init__(self, geometry) 12 | faces = geometry.Faces 13 | faces.ConvertQuadsToTriangles() 14 | self.name = "mesh" 15 | 16 | vertices = self.__get_vertices(geometry) 17 | self.points = vertices 18 | 19 | def __get_vertices(self, geometry): 20 | vertices = [] 21 | for f in geometry.Faces: 22 | 23 | v_a = geometry.Vertices[f.A] 24 | v_b = geometry.Vertices[f.B] 25 | v_c = geometry.Vertices[f.C] 26 | 27 | a_pt = [v_a.X, v_a.Y, v_a.Z] 28 | b_pt = [v_b.X, v_b.Y, v_b.Z] 29 | c_pt = [v_c.X, v_c.Y, v_c.Z] 30 | 31 | vertices.append([a_pt, b_pt, c_pt]) 32 | 33 | return vertices 34 | 35 | def ToString(self): 36 | return 'ShrimpGIS::mesh::{}'.format(len(self.coordinates)) 37 | -------------------------------------------------------------------------------- /lib/shrimp_gis/geometry/multiGeometry.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | """Base Geometry.""" 3 | 4 | from collections import Counter 5 | 6 | 7 | class MultiGeometry(object): 8 | 9 | 10 | def __is_unique_type(self, geometry): 11 | 12 | types = [obj.name for obj in geometry] 13 | 14 | msg = "Please connect just one type among points, curves, surfaces." 15 | 16 | if "mesh" in types: 17 | raise ValueError(msg) 18 | 19 | if len(Counter(types)) != 1: 20 | raise ValueError(msg) 21 | 22 | 23 | def __init__(self, geometry): 24 | 25 | self.__is_unique_type(geometry) 26 | self.geometry = geometry 27 | self.name = "multi" + geometry[0].name 28 | 29 | 30 | def ToString(self): 31 | return 'ShrimpGIS::{}::{}'.format(self.name, len(self.geometry)) -------------------------------------------------------------------------------- /lib/shrimp_gis/geometry/point.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | """Rhino Point for GIS.""" 3 | from base import ShpGeometry 4 | 5 | class ShpPoint(ShpGeometry): 6 | 7 | def __init__(self, geometry): 8 | ShpGeometry.__init__(self, geometry) 9 | self.name = "point" 10 | self.points = geometry 11 | 12 | def ToString(self): 13 | return 'ShrimpGIS::point::{}'.format(len(self.coordinates)) 14 | -------------------------------------------------------------------------------- /lib/shrimp_gis/geometry/pointz.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | """Rhino Point Z for GIS.""" 3 | 4 | from point import ShpPoint 5 | 6 | class ShpPointZ(ShpPoint): 7 | 8 | def __init__(self, geometry): 9 | ShpPoint.__init__(self, geometry) 10 | self.name = "pointZ" 11 | 12 | def ToString(self): 13 | return 'ShrimpGIS::pointZ::{}'.format(len(self.coordinates)) 14 | -------------------------------------------------------------------------------- /lib/shrimp_gis/geometry/polygon.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | """Rhino Surface for GIS.""" 3 | 4 | from curve import ShpCurve 5 | from base import ShpGeometry 6 | import Rhino 7 | 8 | 9 | class ShpPolygon(ShpCurve): 10 | 11 | def __decompose_geometry(self, geometry): 12 | 13 | return Rhino.Geometry.Curve.JoinCurves(geometry.DuplicateEdgeCurves(True)) 14 | 15 | def __init__(self, geometry, number_of_division): 16 | 17 | for srf in geometry.Surfaces: 18 | if not srf.IsPlanar(): 19 | raise ValueError("Surfaces must be planar.") 20 | 21 | ShpGeometry.__init__(self, geometry) 22 | 23 | curves = self.__decompose_geometry(geometry) 24 | 25 | areas = [Rhino.Geometry.AreaMassProperties.Compute(crv).Area for crv in curves] 26 | max_area = max(areas) 27 | 28 | self.points = [] 29 | for crv, area in zip(curves, areas): 30 | direction = crv.ClosedCurveOrientation() 31 | pts = ShpCurve.get_points(crv, number_of_division) 32 | 33 | # I suppose an hole is smaller than shape 34 | if (area < max_area): 35 | if (direction == Rhino.Geometry.CurveOrientation.Clockwise): 36 | pts.reverse() 37 | else: 38 | if (direction == Rhino.Geometry.CurveOrientation.CounterClockwise): 39 | pts.reverse() 40 | 41 | self.points.append(pts) 42 | 43 | self.name = "polygon" 44 | 45 | def ToString(self): 46 | return 'ShrimpGIS::polygon::{}'.format(len(self.coordinates)) 47 | -------------------------------------------------------------------------------- /lib/shrimp_gis/geometry/polygonz.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | """Rhino Surface Z for GIS.""" 3 | 4 | from polygon import ShpPolygon 5 | 6 | class ShpPolygonZ(ShpPolygon): 7 | 8 | def __init__(self, geometry, number_of_division): 9 | ShpPolygon.__init__(self, geometry, number_of_division) 10 | 11 | self.name = "polygonZ" 12 | 13 | def ToString(self): 14 | return 'ShrimpGIS::polygonZ::{}'.format(len(self.coordinates)) 15 | -------------------------------------------------------------------------------- /lib/shrimp_gis/io/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from read import ShpReader, GeojsonReader 3 | from write import ShpWriter, AscWriter, GeojsonWriter 4 | from query import get_epsg_from_shp_point, get_prj_text_from_EPSG 5 | from transformation import get_latlon_from_location, from_nested_lat_lon_to_utm, get_utm_detail_from_location 6 | -------------------------------------------------------------------------------- /lib/shrimp_gis/io/query.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | """ 3 | Query to get EPSG code and other info. It uses epsg.io and 'what's my UTM zone' website formula. 4 | """ 5 | 6 | from System.Net import WebClient 7 | 8 | def get_epsg_from_shp_point(shp_point): 9 | """UTM zone starting at zone 1 from -180°E to -174°E""" 10 | 11 | coordinates = shp_point.coordinates[0] 12 | return int(32700-round((45 + coordinates[0])/90,0)*100+round((183 + coordinates[1])/6,0)) 13 | 14 | 15 | def get_prj_text_from_EPSG(EPSG): 16 | """Get prj string by epsg.io using .Net.""" 17 | 18 | path = "https://epsg.io/" + str(EPSG) + ".wkt" 19 | web_client = WebClient() 20 | try: 21 | web_client.Headers.Add("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)") 22 | prj_text = web_client.DownloadString(path) 23 | except: 24 | raise Exception("Query failed. Please, copy and paste https://epsg.io/?{0}.wkt on your browser, check if text is showed. If yes, use it with gh.".format(EPSG)) 25 | 26 | return prj_text -------------------------------------------------------------------------------- /lib/shrimp_gis/io/read.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | """Shpfile reader. It reads shapefile (support for ESRI Shapefiles WGS84 only).""" 3 | 4 | from shapefile import TRIANGLE_STRIP 5 | import shapefile 6 | import pygeoj 7 | from collections import deque 8 | import Grasshopper 9 | import Rhino 10 | import System 11 | import os 12 | from ..field import Field 13 | from .transformation import from_lat_lon_to_utm 14 | 15 | 16 | class ShpReader(object): 17 | 18 | tol = 0.01 19 | 20 | __supportLevel = { 21 | "supported": (1, 3, 5), 22 | "supported with z" : (11, 13, 15), 23 | "not supported" : (8, 18, 21, 23, 25, 28, 31) 24 | } 25 | 26 | __rhinoType = { 27 | "point": (1, 11), 28 | "curve": (3, 13), 29 | "surface": (5, 15) 30 | } 31 | 32 | def __init__(self, file): 33 | 34 | self.file_name = file 35 | 36 | if (self.__is_shp_file_wgs84()): 37 | 38 | self.sf = shapefile.Reader(file) 39 | self.__set_shape_attributes() 40 | 41 | 42 | def __is_shp_file_wgs84(self): 43 | """ 44 | Temp method: This Method check if prj file is WGS84. 45 | """ 46 | msg = "Only WGS84 (EPSG:4326) is supported.\nPlease reproject vectors using a GIS software (e.g. QGIS) before importing it." 47 | path = os.path.splitext(self.file_name)[0] + ".prj" 48 | 49 | try: 50 | with open(path, 'r') as prj: 51 | content = prj.read() 52 | # ESRI WKT or OGC WKT 53 | if (not "GCS_WGS_1984" in content): 54 | raise ValueError(msg) 55 | return True 56 | except OSError as e: 57 | raise ValueError(msg) 58 | 59 | 60 | def __get_key_value_for_status(self, type, property): 61 | 62 | message = None # for not supported 63 | for i, values in enumerate(property.values()): 64 | if type in values: 65 | message = property.keys()[i] 66 | 67 | return message 68 | 69 | 70 | def __get_num_of_geometry(self): 71 | """ 72 | Get SHP Length 73 | """ 74 | return len(self.sf.shapes()) 75 | 76 | 77 | def __create_fields(self): 78 | """ 79 | Get SHP Fields from shp file 80 | """ 81 | def get_field_values(): 82 | 83 | values = [] 84 | for i in range(self.__get_num_of_geometry()): 85 | values.append(self.sf.record(i)) 86 | 87 | return map(list, zip(*values)) 88 | 89 | def get_field_name(): 90 | 91 | return map(list, zip(*self.sf.fields[1:]))[0] 92 | 93 | field_names = get_field_name() 94 | field_values = get_field_values() 95 | 96 | # all as char. You can parse them easily with GH 97 | return [Field(vl, fn, type=1, length=0, decimal=0) for fn, vl in zip(field_names, field_values)] 98 | 99 | 100 | def __get_geometry_coordinates(self): 101 | """ 102 | Get SHP Coordinates from file 103 | """ 104 | points = [] 105 | for i in range(self.__get_num_of_geometry()): 106 | pts = self.sf.shape(i).points 107 | points.append(pts) 108 | 109 | return points 110 | 111 | 112 | def __get_parts(self): 113 | """ 114 | Get SHP Parts from file 115 | """ 116 | parts = [] 117 | for i in range(self.__get_num_of_geometry()): 118 | part = self.sf.shape(i).parts 119 | parts.append(part) 120 | 121 | return parts 122 | 123 | 124 | def __get_z_values(self): 125 | """ 126 | Get SHP Z from file 127 | """ 128 | z_val = [] 129 | for i in range(self.__get_num_of_geometry()): 130 | z = self.sf.shape(i).z 131 | z_val.append(z) 132 | 133 | return z_val 134 | 135 | 136 | def __adjust_rh_points(self, gh_pts): 137 | 138 | nested_point = [] 139 | for geop, pts in zip(self.parts, gh_pts): 140 | nested_point.append(self.split_list_by_index_list(pts, geop)) 141 | 142 | return nested_point 143 | 144 | 145 | def __set_shape_attributes(self): 146 | """ 147 | Set Rhino SHP attributes 148 | """ 149 | self.type = self.sf.shapeType 150 | self.type_name = self.sf.shapeTypeName 151 | 152 | self.level = self.__get_key_value_for_status(self.type, self.__supportLevel) 153 | self.rhType = self.__get_key_value_for_status(self.type, self.__rhinoType) 154 | 155 | if (self.level == "supported" or self.level == "supported with z"): 156 | self.fields = self.__create_fields() 157 | self.points = self.__get_geometry_coordinates() 158 | self.parts = self.__get_parts() 159 | 160 | # create parts if shp is type 'point' 161 | if (self.type in self.__rhinoType["point"]): 162 | if(not reduce(sum, self.parts)): 163 | self.parts = [[0]]*len(self.parts) 164 | 165 | # flat list of Z-values 166 | if self.level == "supported with z": 167 | self.z = self.__get_z_values() 168 | 169 | 170 | @staticmethod 171 | def split_list_by_index_list(collection, index_list): 172 | 173 | items = deque(index_list) 174 | items.rotate(-1) 175 | shiftedList = list(items)[:-1] 176 | splitter = map(lambda a, b : [a, b], index_list, shiftedList) 177 | return map(lambda x : collection[x[0]:x[1]], splitter) 178 | 179 | 180 | def create_rh_curve(self, gh_pts): 181 | 182 | curves = [] 183 | 184 | for pts in gh_pts: 185 | curves.append(Rhino.Geometry.PolylineCurve(pts)) 186 | 187 | return curves 188 | 189 | 190 | def __surface_post_processing(self, adjusted_points): 191 | 192 | geometries = Grasshopper.DataTree[System.Object]() 193 | 194 | def create_surface_from_curve(curves): 195 | return Rhino.Geometry.Brep.CreatePlanarBreps(curves, self.tol) 196 | 197 | missing_geometry = [] 198 | 199 | gh_nested_curve = [self.create_rh_curve(geo) for geo in adjusted_points] 200 | 201 | for i, curves in enumerate(gh_nested_curve): 202 | 203 | path = Grasshopper.Kernel.Data.GH_Path(i) 204 | surf = create_surface_from_curve(curves) 205 | if surf == None: 206 | missing_geometry.append(i) 207 | else: 208 | geometries.AddRange(surf, path) 209 | 210 | return geometries, missing_geometry 211 | 212 | 213 | def __curve_post_processing(self, adjusted_points): 214 | 215 | geometries = Grasshopper.DataTree[System.Object]() 216 | 217 | missing_geometry = [] 218 | 219 | gh_nested_curve = [self.create_rh_curve(geo) for geo in adjusted_points] 220 | 221 | for i, curves in enumerate(gh_nested_curve): 222 | 223 | path = Grasshopper.Kernel.Data.GH_Path(i) 224 | if (not curves): 225 | missing_geometry.append(i) 226 | else: 227 | geometries.AddRange(curves, path) 228 | 229 | return geometries, missing_geometry 230 | 231 | 232 | def __point_post_processing(self, adjusted_points): 233 | 234 | geometries = Grasshopper.DataTree[System.Object]() 235 | 236 | missing_geometry = [] 237 | 238 | for i, points in enumerate(adjusted_points): 239 | 240 | path = Grasshopper.Kernel.Data.GH_Path(i) 241 | if (not points): 242 | missing_geometry.append(i) 243 | else: 244 | geometries.AddRange(points[0], path) 245 | 246 | return geometries, missing_geometry 247 | 248 | 249 | def get_georeferenced_rhino_geometry(self, gh_pts): 250 | 251 | geometries, missing_geometry = None, None 252 | 253 | if (self.points and self.parts): 254 | 255 | gh_part_points = self.__adjust_rh_points(gh_pts) 256 | 257 | if (self.type in self.__rhinoType["point"]): 258 | geometries, missing_geometry = self.__point_post_processing(gh_part_points) 259 | 260 | elif (self.type in self.__rhinoType["curve"]): 261 | geometries, missing_geometry = self.__curve_post_processing(gh_part_points) 262 | 263 | elif (self.type in self.__rhinoType["surface"]): 264 | geometries, missing_geometry = self.__surface_post_processing(gh_part_points) 265 | 266 | 267 | return geometries, missing_geometry 268 | 269 | @classmethod 270 | def decompose_fields(cls, fields): 271 | 272 | value_tree = Grasshopper.DataTree[System.Object]() 273 | names = [] 274 | 275 | for i, field in enumerate(fields): 276 | names.append(field.name) 277 | values = field.values 278 | path = Grasshopper.Kernel.Data.GH_Path(i) 279 | value_tree.AddRange(values, path) 280 | 281 | return value_tree, names 282 | 283 | 284 | 285 | class GeojsonReader(ShpReader): 286 | 287 | def __init__(self, file): 288 | 289 | self.file = pygeoj.load(file) 290 | self.fields = self.__create_fields() 291 | self.type = self.get_all_type() 292 | self.coordinates = self.get_all_coordinates() 293 | 294 | 295 | def get_all_field_name(self): 296 | """ 297 | Get the list of geojson properties 298 | """ 299 | keys = [] 300 | for feature in self.file: 301 | keys.extend(feature.properties.keys()) 302 | 303 | return list(dict.fromkeys(keys)) 304 | 305 | 306 | def get_all_type(self): 307 | """ 308 | Get the list of geojson type 309 | """ 310 | return [feature.geometry.type for feature in self.file] 311 | 312 | 313 | def get_all_coordinates(self): 314 | """ 315 | Get the list of geojson coordinates 316 | """ 317 | return [feature.geometry.coordinates for feature in self.file] 318 | 319 | 320 | def __create_fields(self): 321 | """ 322 | Create Shp Fields from GeoJson file 323 | """ 324 | fields = [Field([], fn, type=1, length=0, decimal=0) for fn in self.get_all_field_name()] 325 | 326 | for i, feature in enumerate(self.file): 327 | 328 | path = Grasshopper.Kernel.Data.GH_Path(i) 329 | 330 | for field in fields: 331 | if field.name in feature.properties.keys(): 332 | 333 | content = feature.properties[field.name] 334 | 335 | if type(content) == dict: 336 | content = str(content) 337 | 338 | field.values.append(content) 339 | else: 340 | field.values.append(None) 341 | 342 | # all as char. You can parse them easily with GH 343 | return fields 344 | 345 | 346 | def __multi_surface_post_processing(self, points): 347 | """ 348 | Create Surface from MultiPolygon 349 | """ 350 | geometries = [] 351 | for pts in points: 352 | geometries.extend(self.__surface_post_processing(pts)) 353 | 354 | return geometries 355 | 356 | 357 | def __surface_post_processing(self, points): 358 | """ 359 | Create Surface from Polygon and Polygon with holes 360 | """ 361 | def create_surface_from_curve(curves): 362 | return Rhino.Geometry.Brep.CreatePlanarBreps(curves, ShpReader.tol) 363 | 364 | curves = self.create_rh_curve(points) 365 | surfaces = create_surface_from_curve(curves) 366 | 367 | return surfaces 368 | 369 | 370 | def __curve_post_processing(self, points): 371 | """ 372 | Create Curves 373 | """ 374 | return self.create_rh_curve(points) 375 | 376 | 377 | def __get_point_from_geopoint(self, points, location): 378 | """ 379 | Get Rhino point from geojson Point 380 | """ 381 | points = from_lat_lon_to_utm(points, location) 382 | 383 | rh_points = [] 384 | for pt in points: 385 | rh_points.append(Rhino.Geometry.Point3d(pt[0], pt[1], 0)) 386 | return rh_points 387 | 388 | 389 | def __get_point_from_poly_or_multistring(self, geometry, location): 390 | """ 391 | Get Rhino point from geojson Polygon or Multistring 392 | """ 393 | rh_points = [] 394 | for geo in geometry: 395 | rh_points.append(self.__get_point_from_geopoint(geo, location)) 396 | 397 | return rh_points 398 | 399 | 400 | def __get_point_from_multipoly(self, geometry, location): 401 | """ 402 | Get Rhino point from geojson Multipolygon 403 | """ 404 | rh_points = [] 405 | for geo in geometry: 406 | rh_points.append(self.__get_point_from_poly_or_multistring(geo, location)) 407 | 408 | return rh_points 409 | 410 | 411 | def get_georeferenced_rhino_geometry(self, location): 412 | """ 413 | Get Georeferenced Rhino Geometries a in Data Tree 414 | """ 415 | #TODO: Implement a method for missing geometries, if necessary. 416 | geo_list = [] 417 | 418 | location.set_utm() 419 | 420 | for geo_type, geo in zip(self.type, self.coordinates): 421 | if geo_type == "Polygon": 422 | pts = self.__get_point_from_poly_or_multistring(geo, location) 423 | geo_list.append(self.__surface_post_processing(pts)) 424 | elif geo_type == "MultiPolygon": 425 | pts = self.__get_point_from_multipoly(geo, location) 426 | geo_list.append(self.__multi_surface_post_processing(pts)) 427 | elif geo_type == "LineString": 428 | pts = self.__get_point_from_geopoint(geo, location) 429 | geo_list.append(self.create_rh_curve([pts])) 430 | elif geo_type == "MultiLineString": 431 | pts = self.__get_point_from_poly_or_multistring(geo, location) 432 | geo_list.append(self.create_rh_curve(pts)) 433 | elif geo_type == "Point": 434 | pts = self.__get_point_from_geopoint([geo], location) 435 | geo_list.append(pts) 436 | elif geo_type == "MultiPoint": 437 | pts = self.__get_point_from_geopoint(geo, location) 438 | geo_list.append(pts) 439 | 440 | geometries = Grasshopper.DataTree[System.Object]() 441 | 442 | for i, geo in enumerate(geo_list): 443 | path = Grasshopper.Kernel.Data.GH_Path(i) 444 | geometries.AddRange(geo, path) 445 | 446 | return geometries 447 | 448 | -------------------------------------------------------------------------------- /lib/shrimp_gis/io/shapefiles/blockgroups.dbf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/lib/shrimp_gis/io/shapefiles/blockgroups.dbf -------------------------------------------------------------------------------- /lib/shrimp_gis/io/shapefiles/blockgroups.sbn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/lib/shrimp_gis/io/shapefiles/blockgroups.sbn -------------------------------------------------------------------------------- /lib/shrimp_gis/io/shapefiles/blockgroups.sbx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/lib/shrimp_gis/io/shapefiles/blockgroups.sbx -------------------------------------------------------------------------------- /lib/shrimp_gis/io/shapefiles/blockgroups.shp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/lib/shrimp_gis/io/shapefiles/blockgroups.shp -------------------------------------------------------------------------------- /lib/shrimp_gis/io/shapefiles/blockgroups.shx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/lib/shrimp_gis/io/shapefiles/blockgroups.shx -------------------------------------------------------------------------------- /lib/shrimp_gis/io/shapefiles/test/MyPolyZ.dbf: -------------------------------------------------------------------------------- 1 | q A3NAMEC2 PolyZTest -------------------------------------------------------------------------------- /lib/shrimp_gis/io/shapefiles/test/MyPolyZ.shp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/lib/shrimp_gis/io/shapefiles/test/MyPolyZ.shp -------------------------------------------------------------------------------- /lib/shrimp_gis/io/shapefiles/test/MyPolyZ.shx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/lib/shrimp_gis/io/shapefiles/test/MyPolyZ.shx -------------------------------------------------------------------------------- /lib/shrimp_gis/io/shapefiles/test/NullTest.dbf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/lib/shrimp_gis/io/shapefiles/test/NullTest.dbf -------------------------------------------------------------------------------- /lib/shrimp_gis/io/shapefiles/test/NullTest.shp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/lib/shrimp_gis/io/shapefiles/test/NullTest.shp -------------------------------------------------------------------------------- /lib/shrimp_gis/io/shapefiles/test/NullTest.shx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/lib/shrimp_gis/io/shapefiles/test/NullTest.shx -------------------------------------------------------------------------------- /lib/shrimp_gis/io/shapefiles/test/balancing.dbf: -------------------------------------------------------------------------------- 1 | waefield1C2field2C2 row one row two row three row four row five row six row seven -------------------------------------------------------------------------------- /lib/shrimp_gis/io/shapefiles/test/balancing.shp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/lib/shrimp_gis/io/shapefiles/test/balancing.shp -------------------------------------------------------------------------------- /lib/shrimp_gis/io/shapefiles/test/balancing.shx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/lib/shrimp_gis/io/shapefiles/test/balancing.shx -------------------------------------------------------------------------------- /lib/shrimp_gis/io/shapefiles/test/contextwriter.dbf: -------------------------------------------------------------------------------- 1 | w! -------------------------------------------------------------------------------- /lib/shrimp_gis/io/shapefiles/test/contextwriter.shp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/lib/shrimp_gis/io/shapefiles/test/contextwriter.shp -------------------------------------------------------------------------------- /lib/shrimp_gis/io/shapefiles/test/contextwriter.shx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/lib/shrimp_gis/io/shapefiles/test/contextwriter.shx -------------------------------------------------------------------------------- /lib/shrimp_gis/io/shapefiles/test/dtype.dbf: -------------------------------------------------------------------------------- 1 | waQFIRST_FLDC(SECOND_FLDC( First Line First Line -------------------------------------------------------------------------------- /lib/shrimp_gis/io/shapefiles/test/dtype.shp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/lib/shrimp_gis/io/shapefiles/test/dtype.shp -------------------------------------------------------------------------------- /lib/shrimp_gis/io/shapefiles/test/dtype.shx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/lib/shrimp_gis/io/shapefiles/test/dtype.shx -------------------------------------------------------------------------------- /lib/shrimp_gis/io/shapefiles/test/latin1.dbf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/lib/shrimp_gis/io/shapefiles/test/latin1.dbf -------------------------------------------------------------------------------- /lib/shrimp_gis/io/shapefiles/test/latin1.shp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/lib/shrimp_gis/io/shapefiles/test/latin1.shp -------------------------------------------------------------------------------- /lib/shrimp_gis/io/shapefiles/test/line.dbf: -------------------------------------------------------------------------------- 1 | wA3nameC2 linestring1 -------------------------------------------------------------------------------- /lib/shrimp_gis/io/shapefiles/test/line.shp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/lib/shrimp_gis/io/shapefiles/test/line.shp -------------------------------------------------------------------------------- /lib/shrimp_gis/io/shapefiles/test/line.shx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/lib/shrimp_gis/io/shapefiles/test/line.shx -------------------------------------------------------------------------------- /lib/shrimp_gis/io/shapefiles/test/linem.dbf: -------------------------------------------------------------------------------- 1 | wA3nameC2 linem1 -------------------------------------------------------------------------------- /lib/shrimp_gis/io/shapefiles/test/linem.shp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/lib/shrimp_gis/io/shapefiles/test/linem.shp -------------------------------------------------------------------------------- /lib/shrimp_gis/io/shapefiles/test/linem.shx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/lib/shrimp_gis/io/shapefiles/test/linem.shx -------------------------------------------------------------------------------- /lib/shrimp_gis/io/shapefiles/test/linez.dbf: -------------------------------------------------------------------------------- 1 | wA3nameC2 linez1 -------------------------------------------------------------------------------- /lib/shrimp_gis/io/shapefiles/test/linez.shp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/lib/shrimp_gis/io/shapefiles/test/linez.shp -------------------------------------------------------------------------------- /lib/shrimp_gis/io/shapefiles/test/linez.shx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/lib/shrimp_gis/io/shapefiles/test/linez.shx -------------------------------------------------------------------------------- /lib/shrimp_gis/io/shapefiles/test/multipatch.dbf: -------------------------------------------------------------------------------- 1 | wA3nameC2 house1 -------------------------------------------------------------------------------- /lib/shrimp_gis/io/shapefiles/test/multipatch.shp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/lib/shrimp_gis/io/shapefiles/test/multipatch.shp -------------------------------------------------------------------------------- /lib/shrimp_gis/io/shapefiles/test/multipatch.shx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/lib/shrimp_gis/io/shapefiles/test/multipatch.shx -------------------------------------------------------------------------------- /lib/shrimp_gis/io/shapefiles/test/multipoint.dbf: -------------------------------------------------------------------------------- 1 | wA3nameC2 multipoint1 -------------------------------------------------------------------------------- /lib/shrimp_gis/io/shapefiles/test/multipoint.shp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/lib/shrimp_gis/io/shapefiles/test/multipoint.shp -------------------------------------------------------------------------------- /lib/shrimp_gis/io/shapefiles/test/multipoint.shx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/lib/shrimp_gis/io/shapefiles/test/multipoint.shx -------------------------------------------------------------------------------- /lib/shrimp_gis/io/shapefiles/test/onlydbf.dbf: -------------------------------------------------------------------------------- 1 | w! -------------------------------------------------------------------------------- /lib/shrimp_gis/io/shapefiles/test/point.dbf: -------------------------------------------------------------------------------- 1 | wA3nameC2 point1 -------------------------------------------------------------------------------- /lib/shrimp_gis/io/shapefiles/test/point.shp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/lib/shrimp_gis/io/shapefiles/test/point.shp -------------------------------------------------------------------------------- /lib/shrimp_gis/io/shapefiles/test/point.shx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/lib/shrimp_gis/io/shapefiles/test/point.shx -------------------------------------------------------------------------------- /lib/shrimp_gis/io/shapefiles/test/polygon.dbf: -------------------------------------------------------------------------------- 1 | wA3nameC2 polygon1 -------------------------------------------------------------------------------- /lib/shrimp_gis/io/shapefiles/test/polygon.shp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/lib/shrimp_gis/io/shapefiles/test/polygon.shp -------------------------------------------------------------------------------- /lib/shrimp_gis/io/shapefiles/test/polygon.shx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/lib/shrimp_gis/io/shapefiles/test/polygon.shx -------------------------------------------------------------------------------- /lib/shrimp_gis/io/shapefiles/test/shapetype.dbf: -------------------------------------------------------------------------------- 1 | w! -------------------------------------------------------------------------------- /lib/shrimp_gis/io/shapefiles/test/shapetype.shp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/lib/shrimp_gis/io/shapefiles/test/shapetype.shp -------------------------------------------------------------------------------- /lib/shrimp_gis/io/shapefiles/test/shapetype.shx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/lib/shrimp_gis/io/shapefiles/test/shapetype.shx -------------------------------------------------------------------------------- /lib/shrimp_gis/io/shapefiles/test/testfile.dbf: -------------------------------------------------------------------------------- 1 | w! -------------------------------------------------------------------------------- /lib/shrimp_gis/io/shapefiles/test/testfile.shp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/lib/shrimp_gis/io/shapefiles/test/testfile.shp -------------------------------------------------------------------------------- /lib/shrimp_gis/io/shapefiles/test/testfile.shx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/lib/shrimp_gis/io/shapefiles/test/testfile.shx -------------------------------------------------------------------------------- /lib/shrimp_gis/io/transformation.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | """It contains function to use to transform UTM to WGS84 and vice-versa""" 3 | 4 | from ..utm import * 5 | from ..location import Location 6 | import Rhino 7 | 8 | 9 | def get_utm_detail_from_location(location): 10 | return from_latlon(location.latitude, location.longitude) 11 | 12 | 13 | def get_latlon_from_location(pts, location, zvalue=False): 14 | 15 | location.set_utm() 16 | 17 | if zvalue: 18 | utm_pts = [(pt[0] + location.utmx + location.anchor_point.X, pt[1] + location.utmy + location.anchor_point.Y, pt.Z + location.altitude) for pt in pts] 19 | return [list(to_latlon(pt[0], pt[1], location.zone, location.letter)) + [pt[2]] for pt in utm_pts] 20 | else: 21 | utm_pts = [(pt[0] + location.utmx + location.anchor_point.X, pt[1] + location.utmy + location.anchor_point.Y) for pt in pts] 22 | return [to_latlon(pt[0], pt[1], location.zone, location.letter) for pt in utm_pts] 23 | 24 | 25 | def from_lat_lon_to_utm(points, location): 26 | 27 | points = map(lambda pt: from_latlon(pt[1], pt[0]), points) 28 | 29 | return map(lambda pt: Rhino.Geometry.Point3d(pt[0] - location.utmx - location.anchor_point.X, pt[1] - location.utmy - location.anchor_point.Y, 0), points) 30 | 31 | 32 | def from_nested_lat_lon_to_utm(point_group, location): 33 | 34 | location.set_utm() 35 | 36 | utm_points = [] 37 | for pts in point_group: 38 | utm_points.append(from_lat_lon_to_utm(pts, location)) 39 | 40 | return utm_points 41 | 42 | 43 | -------------------------------------------------------------------------------- /lib/shrimp_gis/io/write.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | """ 3 | Shpfile writer. It writes shapefile (support for ESRI Shapefiles WGS84 only). 4 | Raster writer. It writes asc files and UTM WGS84 prj files. 5 | """ 6 | 7 | from shapefile import TRIANGLE_STRIP 8 | import shapefile 9 | import pygeoj 10 | import Grasshopper 11 | import os 12 | import uuid 13 | from ..field import Field 14 | 15 | 16 | class AscWriter(object): 17 | 18 | def __init__(self, matrix, pixel_size, xllcenter, yllcenter): 19 | 20 | self.ERSI_ASCII = { 21 | "ncols": matrix.num_x, 22 | "nrows": matrix.num_y, 23 | "xllcenter": xllcenter, 24 | "yllcenter": yllcenter, 25 | "cellsize": pixel_size, 26 | "NODATA_value" : -9999 27 | } 28 | 29 | self.matrix = matrix.ASCII_matrix 30 | 31 | def get_asc(self, folder, name, prj_text): 32 | 33 | full_path_asc = os.path.join(folder, name + ".asc") 34 | full_path_prj = os.path.join(folder, name + ".prj") 35 | 36 | with open(full_path_asc, 'w') as f: 37 | 38 | header = [] 39 | for k, v in self.ERSI_ASCII.items(): 40 | header.append(" ".join(map(str, [k, v]))) 41 | header = "\n".join(header) 42 | 43 | f.writelines(header) 44 | f.writelines("\n") 45 | f.writelines(self.matrix) 46 | 47 | with open(full_path_prj, 'w') as f: 48 | f.write(prj_text) 49 | 50 | return full_path_asc 51 | 52 | 53 | class ShpWriter(object): 54 | 55 | def __is_unique_type(self, shp_geometry): 56 | 57 | main_type = shp_geometry[0].name 58 | for geo in shp_geometry: 59 | if geo.name != main_type: 60 | return False, main_type 61 | return True, main_type 62 | 63 | 64 | def field_legth_checking(self, shp_field, shp_geometry): 65 | 66 | for field in shp_field: 67 | if len(field.values) != len(shp_geometry): 68 | return False 69 | return True 70 | 71 | 72 | def create_valid_folder(self, folder): 73 | if not os.path.exists(folder): 74 | try: 75 | os.mkdir(folder) 76 | except: 77 | return False 78 | return True 79 | 80 | 81 | def __write_curve(self, shp_geometry, shp_write): 82 | [shp_write.line([[[pt[1], pt[0]] for pt in geo.coordinates]]) for geo in shp_geometry] 83 | 84 | 85 | def __write_curvez(self, shp_geometry, shp_write): 86 | [shp_write.linez([[[pt[1], pt[0], pt[2]] for pt in geo.coordinates]]) for geo in shp_geometry] 87 | 88 | 89 | def __write_polygon(self, shp_geometry, shp_write): 90 | for geo in shp_geometry: 91 | chunk = [] 92 | for pts in geo.coordinates: 93 | chunk.append([[pt[1], pt[0]] for pt in pts]) 94 | shp_write.poly(chunk) 95 | 96 | 97 | def __write_polygonz(self, shp_geometry, shp_write): 98 | for geo in shp_geometry: 99 | chunk = [] 100 | for pts in geo.coordinates: 101 | chunk.append([[pt[1], pt[0], pt[2]] for pt in pts]) 102 | shp_write.polyz(chunk) 103 | 104 | 105 | def __write_point(self, shp_geometry, shp_write): 106 | for geo in shp_geometry: 107 | for pt in geo.coordinates: 108 | shp_write.point(pt[1], pt[0]) 109 | 110 | 111 | def __write_pointz(self, shp_geometry, shp_write): 112 | for geo in shp_geometry: 113 | for pt in geo.coordinates: 114 | shp_write.pointz(pt[1], pt[0], pt[2]) 115 | 116 | 117 | def __write_multy_patch(self, shp_geometry, shp_write): 118 | for geo in shp_geometry: 119 | parts = [] 120 | for face_points, face_coordinates in zip(geo.points, geo.coordinates): 121 | face = [] 122 | for pt, cd in zip(face_points, face_coordinates): 123 | face.append([cd[1], cd[0], pt[2]]) 124 | parts.append(face) 125 | shp_write.multipatch(parts,partTypes=[TRIANGLE_STRIP]*len(parts)) 126 | 127 | 128 | #TODO: Add epsg code as input. Call epsg.io API or other to retrieve prj string. Write prj file. It does not work within Rhino for now. 129 | def write_prj_file(self, folder, file_name): 130 | wgs84prjString = "GEOGCS[\"GCS_WGS_1984\",DATUM[\"D_WGS_1984\",SPHEROID[\"WGS_1984\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433]]" 131 | 132 | with open(os.path.join(folder, file_name + ".prj"), "w") as prj_file: 133 | prj_file.write(wgs84prjString) 134 | 135 | 136 | def write_shp_file(self, folder, file_name, shp_geometry, shp_field): 137 | 138 | if (len(shp_field) == 0): 139 | values = [uuid.uuid4() for i in range(len(shp_geometry))] 140 | shp_field = [Field(values, 'UUID', 'C', 40, 0)] 141 | 142 | unique_test, main_type = self.__is_unique_type(shp_geometry) 143 | 144 | if (unique_test and self.field_legth_checking(shp_field, shp_geometry) and self.create_valid_folder(folder)): 145 | 146 | full_path = os.path.join(folder, file_name + ".shp") 147 | w = shapefile.Writer(os.path.join(folder, file_name + ".shp")) 148 | 149 | values = [] 150 | for field in shp_field: 151 | if field.type == 'L': 152 | values.append(map(int, field.values)) 153 | continue 154 | values.append(field.values) 155 | 156 | if (main_type == "curve"): 157 | self.__write_curve(shp_geometry, w) 158 | 159 | elif (main_type == "polygon"): 160 | self.__write_polygon(shp_geometry, w) 161 | 162 | elif (main_type == "point"): 163 | self.__write_point(shp_geometry, w) 164 | 165 | elif (main_type == "mesh"): 166 | self.__write_multy_patch(shp_geometry, w) 167 | 168 | elif (main_type == "curveZ"): 169 | self.__write_curvez(shp_geometry, w) 170 | 171 | elif (main_type == "polygonZ"): 172 | self.__write_polygonz(shp_geometry, w) 173 | 174 | elif (main_type == "pointZ"): 175 | self.__write_pointz(shp_geometry, w) 176 | 177 | # unwrap fields 178 | for field in shp_field: 179 | w.field(field.name, field.type, field.length, field.decimal) 180 | 181 | for val in map(list, zip(*values)): 182 | w.record(*val) 183 | 184 | # ESRI WKT 185 | self.write_prj_file(folder, file_name) 186 | 187 | w.close() 188 | 189 | return full_path 190 | 191 | else: 192 | return False 193 | 194 | 195 | class GeojsonWriter(ShpWriter): 196 | 197 | #TODO: Implement z values. Only 2d for now. 198 | def __write_point(self, index, geojson, shp_geometry, shp_field): 199 | 200 | prop = {} 201 | geom = {"type":"Point"} 202 | 203 | geom["coordinates"] = [shp_geometry.coordinates[0][1], shp_geometry.coordinates[0][0]] 204 | 205 | for field in shp_field: 206 | prop[field.name] = field.values[index] 207 | 208 | geojson.add_feature ( properties=prop, geometry=geom ) 209 | 210 | 211 | def __write_multi_point(self, index, geojson, shp_geometry, shp_field): 212 | 213 | prop = {} 214 | geom = {"type":"MultiPoint"} 215 | 216 | coordinates = [] 217 | for geo in shp_geometry.geometry: 218 | for pt in geo.coordinates: 219 | coordinates.append([pt[1], pt[0]]) 220 | 221 | geom["coordinates"] = coordinates 222 | 223 | for field in shp_field: 224 | prop[field.name] = field.values[index] 225 | 226 | geojson.add_feature ( properties=prop, geometry=geom ) 227 | 228 | 229 | def __write_linestring(self, index, geojson, shp_geometry, shp_field): 230 | 231 | prop = {} 232 | geom = {"type":"LineString"} 233 | 234 | geom["coordinates"] = [[pt[1], pt[0]] for pt in shp_geometry.coordinates] 235 | 236 | for field in shp_field: 237 | prop[field.name] = field.values[index] 238 | 239 | geojson.add_feature ( properties=prop, geometry=geom ) 240 | 241 | 242 | def __write_multi_linestring(self, index, geojson, shp_geometry, shp_field): 243 | 244 | prop = {} 245 | geom = {"type":"MultiLineString"} 246 | 247 | coordinates = [] 248 | for geo in shp_geometry.geometry: 249 | coordinates.append([[pt[1], pt[0]] for pt in geo.coordinates]) 250 | 251 | geom["coordinates"] = coordinates 252 | 253 | for field in shp_field: 254 | prop[field.name] = field.values[index] 255 | 256 | geojson.add_feature ( properties=prop, geometry=geom ) 257 | 258 | 259 | def __write_polygon(self, index, geojson, shp_geometry, shp_field): 260 | 261 | prop = {} 262 | geom = {"type":"Polygon"} 263 | 264 | coordinates = [] 265 | for geo in shp_geometry.coordinates: 266 | coordinates.append([[pt[1], pt[0]] for pt in geo]) 267 | 268 | geom["coordinates"] = coordinates 269 | 270 | for field in shp_field: 271 | prop[field.name] = field.values[index] 272 | 273 | geojson.add_feature ( properties=prop, geometry=geom ) 274 | 275 | 276 | def __write_multi_polygon(self, index, geojson, shp_geometry, shp_field): 277 | 278 | prop = {} 279 | geom = {"type":"MultiPolygon"} 280 | 281 | coordinates = [] 282 | for geo in shp_geometry.geometry: 283 | curve = [] 284 | for pts in geo.coordinates: 285 | curve.append([[pt[1], pt[0]] for pt in pts]) 286 | coordinates.append(curve) 287 | 288 | geom["coordinates"] = coordinates 289 | 290 | for field in shp_field: 291 | prop[field.name] = field.values[index] 292 | 293 | geojson.add_feature ( properties=prop, geometry=geom ) 294 | 295 | 296 | def write_geojson_file(self, folder, file_name, shp_geometry, shp_field): 297 | 298 | if (len(shp_field) == 0): 299 | values = [str(uuid.uuid4()) for i in range(len(shp_geometry))] 300 | shp_field = [Field(values, 'UUID', 'C', 40, 0)] 301 | 302 | full_path = os.path.join(folder, file_name + ".json") 303 | 304 | geojson = pygeoj.new() 305 | 306 | if (self.field_legth_checking(shp_field, shp_geometry) and self.create_valid_folder(folder)): 307 | 308 | for i, geometry in enumerate(shp_geometry): 309 | if geometry.name == "point": 310 | self.__write_point(i, geojson, geometry, shp_field) 311 | elif geometry.name == "multipoint": 312 | self.__write_multi_point(i, geojson, geometry, shp_field) 313 | elif geometry.name == "curve": 314 | self.__write_linestring(i, geojson, geometry, shp_field) 315 | elif geometry.name == "multicurve": 316 | self.__write_multi_linestring(i, geojson, geometry, shp_field) 317 | elif geometry.name == "polygon": 318 | self.__write_polygon(i, geojson, geometry, shp_field) 319 | elif geometry.name == "multipolygon": 320 | self.__write_multi_polygon(i, geojson, geometry, shp_field) 321 | 322 | geojson.add_all_bboxes() 323 | geojson.update_bbox() 324 | geojson.save(full_path) 325 | 326 | return full_path 327 | 328 | else: 329 | return False 330 | 331 | @classmethod 332 | def merge_geojson(cls, folder, file_name, files): 333 | 334 | geojson = pygeoj.new() 335 | for path in files: 336 | f = pygeoj.load(path) 337 | for feature in f: 338 | geojson.add_feature(obj=feature) 339 | 340 | full_path = os.path.join(folder, file_name + ".json") 341 | 342 | geojson.add_all_bboxes() 343 | geojson.update_bbox() 344 | geojson.save(full_path) 345 | 346 | return full_path 347 | 348 | 349 | -------------------------------------------------------------------------------- /lib/shrimp_gis/lic/pygeo_license.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2018 Karim Bahgat 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /lib/shrimp_gis/lic/shapefiles_license.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright © 2013 Joel Lawhead 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /lib/shrimp_gis/lic/utm_license.txt: -------------------------------------------------------------------------------- 1 | utm 2 | === 3 | 4 | .. image:: https://travis-ci.org/Turbo87/utm.png 5 | 6 | .. image:: https://img.shields.io/badge/License-MIT-yellow.svg 7 | :target: https://github.com/Turbo87/utm/blob/master/LICENSE 8 | 9 | 10 | Bidirectional UTM-WGS84 converter for python 11 | 12 | Usage 13 | ----- 14 | 15 | .. code-block:: python 16 | 17 | import utm 18 | 19 | Convert a (latitude, longitude) tuple into an UTM coordinate: 20 | 21 | .. code-block:: python 22 | 23 | utm.from_latlon(51.2, 7.5) 24 | >>> (395201.3103811303, 5673135.241182375, 32, 'U') 25 | 26 | The syntax is **utm.from_latlon(LATITUDE, LONGITUDE)**. 27 | 28 | The return has the form **(EASTING, NORTHING, ZONE NUMBER, ZONE LETTER)**. 29 | 30 | Convert an UTM coordinate into a (latitude, longitude) tuple: 31 | 32 | .. code-block:: python 33 | 34 | utm.to_latlon(340000, 5710000, 32, 'U') 35 | >>> (51.51852098408468, 6.693872395145327) 36 | 37 | The syntax is **utm.to_latlon(EASTING, NORTHING, ZONE NUMBER, ZONE LETTER)**. 38 | 39 | The return has the form **(LATITUDE, LONGITUDE)**. 40 | 41 | Since the zone letter is not strictly needed for the conversion you may also 42 | the ``northern`` parameter instead, which is a named parameter and can be set 43 | to either ``True`` or ``False``. Have a look at the unit tests to see how it 44 | can be used. 45 | 46 | The UTM coordinate system is explained on 47 | `this `_ 48 | Wikipedia page. 49 | 50 | Speed 51 | ----- 52 | 53 | The library has been compared to the more generic pyproj library by running the 54 | unit test suite through pyproj instead of utm. These are the results: 55 | 56 | * with pyproj (without projection cache): 4.0 - 4.5 sec 57 | * with pyproj (with projection cache): 0.9 - 1.0 sec 58 | * with utm: 0.4 - 0.5 sec 59 | 60 | Development 61 | ----------- 62 | 63 | Create a new ``virtualenv`` and install the library via ``pip install -e .``. 64 | After that install the ``pytest`` package via ``pip install pytest`` and run 65 | the unit test suite by calling ``py.test``. 66 | 67 | Changelog 68 | --------- 69 | 70 | see `CHANGELOG.rst `_ file 71 | 72 | Authors 73 | ------- 74 | 75 | * Bart van Andel 76 | * Tobias Bieniek 77 | * Torstein I. Bø 78 | 79 | License 80 | ------- 81 | 82 | Copyright (C) 2012 Tobias Bieniek 83 | 84 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 85 | 86 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 87 | 88 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 89 | -------------------------------------------------------------------------------- /lib/shrimp_gis/location.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | """Shape field. Gismo tag to export.""" 3 | import Rhino 4 | import io.transformation 5 | 6 | 7 | class Location(object): 8 | """This class create Envimet Location Attributes (Location Name, Latitude, Longitude).""" 9 | 10 | def __init__(self, name = "ShrimpGIS-Location", latitude = 0, longitude = 0, anchor_point = Rhino.Geometry.Point3d.Origin, altitude = 0): 11 | 12 | self.altitude = altitude 13 | self.anchor_point = anchor_point 14 | self.__latitude = latitude 15 | self.__longitude = longitude 16 | self.name = name 17 | 18 | 19 | def set_utm(self): 20 | 21 | utmx, utmy, zone, letter = io.transformation.get_utm_detail_from_location(self) 22 | self.utmx = utmx 23 | self.utmy = utmy 24 | self.zone = zone 25 | self.letter = letter 26 | 27 | @property 28 | def latitude(self): 29 | """Latitude limits (-80.0 to 84.0) """ 30 | return self.__latitude 31 | 32 | @latitude.setter 33 | def latitude(self, value): 34 | self.__latitude = 0 35 | if (value <= 84 and value >= -80): 36 | self.__latitude = value 37 | 38 | @property 39 | def longitude(self): 40 | """Latitude limits (-180.0 to 180.0) """ 41 | return self.__longitude 42 | 43 | @longitude.setter 44 | def longitude(self, value): 45 | self.__longitude = 0 46 | if (value <= 180 and value >= -180): 47 | self.__longitude = value 48 | 49 | def ToString(self): 50 | return "{0}::{1}::{2}".format(self.name, self.__latitude, self.__longitude) 51 | -------------------------------------------------------------------------------- /lib/shrimp_gis/scripts/utm-converter: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import argparse 4 | import utm 5 | 6 | parser = argparse.ArgumentParser(description='Bidirectional UTM-WGS84 converter for python') 7 | subparsers = parser.add_subparsers() 8 | 9 | parser_latlon = subparsers.add_parser('latlon', help='Convert a latitude/longitude pair WGS84 to UTM') 10 | parser_latlon.add_argument('latitude', type=float, help='Latitude of the WGS84 coordinate') 11 | parser_latlon.add_argument('longitude', type=float, help='Longitude of the WGS84 coordinate') 12 | 13 | parser_utm = subparsers.add_parser('utm', help='Convert a UTM coordinate to WGS84') 14 | parser_utm.add_argument('easting', type=int, help='Easting component of the UTM coordinate') 15 | parser_utm.add_argument('northing', type=int, help='Northing component of the UTM coordinate') 16 | parser_utm.add_argument('zone_number', type=int, help='Zone number of the UTM coordinate') 17 | parser_utm.add_argument('zone_letter', help='Zone letter of the UTM coordinate') 18 | 19 | args = parser.parse_args() 20 | 21 | if all(arg in args for arg in ['easting', 'northing', 'zone_number', 'zone_letter']): 22 | if args.zone_letter == '': 23 | parser_utm.print_usage() 24 | print "utm-converter utm: error: too few arguments" 25 | exit() 26 | 27 | coordinate = utm.to_latlon(args.easting, args.northing, 28 | args.zone_number, args.zone_letter) 29 | 30 | elif all(arg in args for arg in ['latitude', 'longitude']): 31 | coordinate = utm.from_latlon(args.latitude, args.longitude) 32 | 33 | print ','.join([str(component) for component in coordinate]) 34 | -------------------------------------------------------------------------------- /lib/shrimp_gis/utm/__init__.py: -------------------------------------------------------------------------------- 1 | from conversion import to_latlon, from_latlon, latlon_to_zone_number, latitude_to_zone_letter, check_valid_zone 2 | from error import OutOfRangeError 3 | -------------------------------------------------------------------------------- /lib/shrimp_gis/utm/conversion.py: -------------------------------------------------------------------------------- 1 | from error import OutOfRangeError 2 | 3 | # When UTM (which can optionally use numpy == 1.16.6) is used inside ShrimpGIS, 4 | # numpy may well be "indistinguishable" from math, but it is not distinguishable 5 | # from later versions of numpy, e.g. that installed by LadyBug Tools. JP 6 | 7 | import math as mathlib 8 | use_numpy = False 9 | 10 | __all__ = ['to_latlon', 'from_latlon'] 11 | 12 | K0 = 0.9996 13 | 14 | E = 0.00669438 15 | E2 = E * E 16 | E3 = E2 * E 17 | E_P2 = E / (1.0 - E) 18 | 19 | SQRT_E = mathlib.sqrt(1 - E) 20 | _E = (1 - SQRT_E) / (1 + SQRT_E) 21 | _E2 = _E * _E 22 | _E3 = _E2 * _E 23 | _E4 = _E3 * _E 24 | _E5 = _E4 * _E 25 | 26 | M1 = (1 - E / 4 - 3 * E2 / 64 - 5 * E3 / 256) 27 | M2 = (3 * E / 8 + 3 * E2 / 32 + 45 * E3 / 1024) 28 | M3 = (15 * E2 / 256 + 45 * E3 / 1024) 29 | M4 = (35 * E3 / 3072) 30 | 31 | P2 = (3. / 2 * _E - 27. / 32 * _E3 + 269. / 512 * _E5) 32 | P3 = (21. / 16 * _E2 - 55. / 32 * _E4) 33 | P4 = (151. / 96 * _E3 - 417. / 128 * _E5) 34 | P5 = (1097. / 512 * _E4) 35 | 36 | R = 6378137 37 | 38 | ZONE_LETTERS = "CDEFGHJKLMNPQRSTUVWXX" 39 | 40 | 41 | def in_bounds(x, lower, upper, upper_strict=False): 42 | if upper_strict and use_numpy: 43 | return lower <= mathlib.min(x) and mathlib.max(x) < upper 44 | elif upper_strict and not use_numpy: 45 | return lower <= x < upper 46 | elif use_numpy: 47 | return lower <= mathlib.min(x) and mathlib.max(x) <= upper 48 | return lower <= x <= upper 49 | 50 | 51 | def check_valid_zone(zone_number, zone_letter): 52 | if not 1 <= zone_number <= 60: 53 | raise OutOfRangeError('zone number out of range (must be between 1 and 60)') 54 | 55 | if zone_letter: 56 | zone_letter = zone_letter.upper() 57 | 58 | if not 'C' <= zone_letter <= 'X' or zone_letter in ['I', 'O']: 59 | raise OutOfRangeError('zone letter out of range (must be between C and X)') 60 | 61 | 62 | def mixed_signs(x): 63 | return use_numpy and mathlib.min(x) < 0 and mathlib.max(x) >= 0 64 | 65 | 66 | def negative(x): 67 | if use_numpy: 68 | return mathlib.max(x) < 0 69 | return x < 0 70 | 71 | 72 | def to_latlon(easting, northing, zone_number, zone_letter=None, northern=None, strict=True): 73 | """This function convert an UTM coordinate into Latitude and Longitude 74 | 75 | Parameters 76 | ---------- 77 | easting: int 78 | Easting value of UTM coordinate 79 | 80 | northing: int 81 | Northing value of UTM coordinate 82 | 83 | zone number: int 84 | Zone Number is represented with global map numbers of an UTM Zone 85 | Numbers Map. More information see utmzones [1]_ 86 | 87 | zone_letter: str 88 | Zone Letter can be represented as string values. Where UTM Zone 89 | Designators can be accessed in [1]_ 90 | 91 | northern: bool 92 | You can set True or False to set this parameter. Default is None 93 | 94 | 95 | .. _[1]: http://www.jaworski.ca/utmzones.htm 96 | 97 | """ 98 | if not zone_letter and northern is None: 99 | raise ValueError('either zone_letter or northern needs to be set') 100 | 101 | elif zone_letter and northern is not None: 102 | raise ValueError('set either zone_letter or northern, but not both') 103 | 104 | if strict: 105 | if not in_bounds(easting, 100000, 1000000, upper_strict=True): 106 | raise OutOfRangeError('easting out of range (must be between 100.000 m and 999.999 m)') 107 | if not in_bounds(northing, 0, 10000000): 108 | raise OutOfRangeError('northing out of range (must be between 0 m and 10.000.000 m)') 109 | 110 | check_valid_zone(zone_number, zone_letter) 111 | 112 | if zone_letter: 113 | zone_letter = zone_letter.upper() 114 | northern = (zone_letter >= 'N') 115 | 116 | x = easting - 500000 117 | y = northing 118 | 119 | if not northern: 120 | y -= 10000000 121 | 122 | m = y / K0 123 | mu = m / (R * M1) 124 | 125 | p_rad = (mu + 126 | P2 * mathlib.sin(2 * mu) + 127 | P3 * mathlib.sin(4 * mu) + 128 | P4 * mathlib.sin(6 * mu) + 129 | P5 * mathlib.sin(8 * mu)) 130 | 131 | p_sin = mathlib.sin(p_rad) 132 | p_sin2 = p_sin * p_sin 133 | 134 | p_cos = mathlib.cos(p_rad) 135 | 136 | p_tan = p_sin / p_cos 137 | p_tan2 = p_tan * p_tan 138 | p_tan4 = p_tan2 * p_tan2 139 | 140 | ep_sin = 1 - E * p_sin2 141 | ep_sin_sqrt = mathlib.sqrt(1 - E * p_sin2) 142 | 143 | n = R / ep_sin_sqrt 144 | r = (1 - E) / ep_sin 145 | 146 | #c = _E * p_cos**2 147 | c = E_P2 * p_cos**2 148 | c2 = c * c 149 | 150 | d = x / (n * K0) 151 | d2 = d * d 152 | d3 = d2 * d 153 | d4 = d3 * d 154 | d5 = d4 * d 155 | d6 = d5 * d 156 | 157 | latitude = (p_rad - (p_tan / r) * 158 | (d2 / 2 - 159 | d4 / 24 * (5 + 3 * p_tan2 + 10 * c - 4 * c2 - 9 * E_P2)) + 160 | d6 / 720 * (61 + 90 * p_tan2 + 298 * c + 45 * p_tan4 - 252 * E_P2 - 3 * c2)) 161 | 162 | longitude = (d - 163 | d3 / 6 * (1 + 2 * p_tan2 + c) + 164 | d5 / 120 * (5 - 2 * c + 28 * p_tan2 - 3 * c2 + 8 * E_P2 + 24 * p_tan4)) / p_cos 165 | 166 | return (mathlib.degrees(latitude), 167 | mathlib.degrees(longitude) + zone_number_to_central_longitude(zone_number)) 168 | 169 | 170 | def from_latlon(latitude, longitude, force_zone_number=None, force_zone_letter=None): 171 | """This function convert Latitude and Longitude to UTM coordinate 172 | 173 | Parameters 174 | ---------- 175 | latitude: float 176 | Latitude between 80 deg S and 84 deg N, e.g. (-80.0 to 84.0) 177 | 178 | longitude: float 179 | Longitude between 180 deg W and 180 deg E, e.g. (-180.0 to 180.0). 180 | 181 | force_zone number: int 182 | Zone Number is represented with global map numbers of an UTM Zone 183 | Numbers Map. You may force conversion including one UTM Zone Number. 184 | More information see utmzones [1]_ 185 | 186 | .. _[1]: http://www.jaworski.ca/utmzones.htm 187 | """ 188 | if not in_bounds(latitude, -80.0, 84.0): 189 | raise OutOfRangeError('latitude out of range (must be between 80 deg S and 84 deg N)') 190 | if not in_bounds(longitude, -180.0, 180.0): 191 | raise OutOfRangeError('longitude out of range (must be between 180 deg W and 180 deg E)') 192 | if force_zone_number is not None: 193 | check_valid_zone(force_zone_number, force_zone_letter) 194 | 195 | lat_rad = mathlib.radians(latitude) 196 | lat_sin = mathlib.sin(lat_rad) 197 | lat_cos = mathlib.cos(lat_rad) 198 | 199 | lat_tan = lat_sin / lat_cos 200 | lat_tan2 = lat_tan * lat_tan 201 | lat_tan4 = lat_tan2 * lat_tan2 202 | 203 | if force_zone_number is None: 204 | zone_number = latlon_to_zone_number(latitude, longitude) 205 | else: 206 | zone_number = force_zone_number 207 | 208 | if force_zone_letter is None: 209 | zone_letter = latitude_to_zone_letter(latitude) 210 | else: 211 | zone_letter = force_zone_letter 212 | 213 | lon_rad = mathlib.radians(longitude) 214 | central_lon = zone_number_to_central_longitude(zone_number) 215 | central_lon_rad = mathlib.radians(central_lon) 216 | 217 | n = R / mathlib.sqrt(1 - E * lat_sin**2) 218 | c = E_P2 * lat_cos**2 219 | 220 | a = lat_cos * (lon_rad - central_lon_rad) 221 | a2 = a * a 222 | a3 = a2 * a 223 | a4 = a3 * a 224 | a5 = a4 * a 225 | a6 = a5 * a 226 | 227 | m = R * (M1 * lat_rad - 228 | M2 * mathlib.sin(2 * lat_rad) + 229 | M3 * mathlib.sin(4 * lat_rad) - 230 | M4 * mathlib.sin(6 * lat_rad)) 231 | 232 | easting = K0 * n * (a + 233 | a3 / 6 * (1 - lat_tan2 + c) + 234 | a5 / 120 * (5 - 18 * lat_tan2 + lat_tan4 + 72 * c - 58 * E_P2)) + 500000 235 | 236 | northing = K0 * (m + n * lat_tan * (a2 / 2 + 237 | a4 / 24 * (5 - lat_tan2 + 9 * c + 4 * c**2) + 238 | a6 / 720 * (61 - 58 * lat_tan2 + lat_tan4 + 600 * c - 330 * E_P2))) 239 | 240 | if mixed_signs(latitude): 241 | raise ValueError("latitudes must all have the same sign") 242 | elif negative(latitude): 243 | northing += 10000000 244 | 245 | return easting, northing, zone_number, zone_letter 246 | 247 | 248 | def latitude_to_zone_letter(latitude): 249 | # If the input is a numpy array, just use the first element 250 | # User responsibility to make sure that all points are in one zone 251 | if use_numpy and isinstance(latitude, mathlib.ndarray): 252 | latitude = latitude.flat[0] 253 | 254 | if -80 <= latitude <= 84: 255 | return ZONE_LETTERS[int(latitude + 80) >> 3] 256 | else: 257 | return None 258 | 259 | 260 | def latlon_to_zone_number(latitude, longitude): 261 | # If the input is a numpy array, just use the first element 262 | # User responsibility to make sure that all points are in one zone 263 | if use_numpy: 264 | if isinstance(latitude, mathlib.ndarray): 265 | latitude = latitude.flat[0] 266 | if isinstance(longitude, mathlib.ndarray): 267 | longitude = longitude.flat[0] 268 | 269 | if 56 <= latitude < 64 and 3 <= longitude < 12: 270 | return 32 271 | 272 | if 72 <= latitude <= 84 and longitude >= 0: 273 | if longitude < 9: 274 | return 31 275 | elif longitude < 21: 276 | return 33 277 | elif longitude < 33: 278 | return 35 279 | elif longitude < 42: 280 | return 37 281 | 282 | return int((longitude + 180) / 6) + 1 283 | 284 | 285 | def zone_number_to_central_longitude(zone_number): 286 | return (zone_number - 1) * 6 - 180 + 3 287 | -------------------------------------------------------------------------------- /lib/shrimp_gis/utm/error.py: -------------------------------------------------------------------------------- 1 | class OutOfRangeError(ValueError): 2 | pass 3 | -------------------------------------------------------------------------------- /resources/lb_shrimpgis_threejs_qgis/Qgis2threejs.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-family: arial, sans-serif; 3 | margin: 0; 4 | overflow: hidden; 5 | } 6 | 7 | #view { 8 | position: absolute; 9 | width: 100%; 10 | height: 100%; 11 | } 12 | 13 | #view.sky { 14 | background: -webkit-gradient(linear, left top, left bottom, from(#98c8f6), color-stop(0.4, #cbebff), to(#f0f9ff)); 15 | background: linear-gradient(to bottom, #98c8f6 0%,#cbebff 40%,#f0f9ff 100%); 16 | } 17 | 18 | .hidden { 19 | display: none !important; 20 | } 21 | 22 | .queryable { 23 | cursor: pointer; 24 | } 25 | 26 | .no-events { 27 | pointer-events: none; 28 | } 29 | 30 | #labels { 31 | } 32 | 33 | .label { 34 | position: absolute; 35 | padding: 2px; 36 | text-shadow: -1px -1px #FFF, 0px -1px #FFF, 1px -1px #FFF, -1px 0px #FFF, 1px 0px #FFF, -1px 1px #FFF, 0px 1px #FFF, 1px 1px #FFF; 37 | } 38 | 39 | .print-label { 40 | /* these 2 properties are copied to canvas 2D context in renderLabels function of Qgis2threejs.js */ 41 | color: black; 42 | font: normal medium sans-serif; 43 | } 44 | 45 | #progress { 46 | position: absolute; 47 | top: 0; 48 | left: 0; 49 | width: 100%; 50 | height: 5px; 51 | } 52 | 53 | #bar { 54 | width: 0; 55 | height: 5px; 56 | background-color: #2196F3; 57 | opacity: 1; 58 | } 59 | 60 | #bar.fadeout { 61 | opacity: 0; 62 | height: 0; 63 | transition: all .4s; 64 | } 65 | 66 | #header { 67 | position: absolute; 68 | left: 5px; 69 | top: 5px; 70 | } 71 | 72 | #footer { 73 | position: absolute; 74 | left: 5px; 75 | bottom: 5px; 76 | } 77 | 78 | #infobtn { 79 | cursor: pointer; 80 | } 81 | 82 | #infobtn img { 83 | width: 24px; 84 | height: 24px; 85 | } 86 | 87 | /* popup */ 88 | #popup { 89 | position: absolute; 90 | left: 2px; 91 | top: 2px; 92 | max-width: 480px; 93 | min-width: 300px; 94 | z-index: 9999; 95 | border: solid gray; 96 | border-width: 1px 2px 2px; 97 | border-radius: 3px; 98 | display: none; 99 | } 100 | 101 | #popupbar { 102 | background: dimgray; 103 | color: white; 104 | padding-left: 4px; 105 | height: 18px; 106 | border-radius: 3px 3px 0 0; 107 | } 108 | 109 | #closebtn { 110 | color: rgb(220, 220, 220); 111 | background: gray; 112 | border: 1px solid darkgray; 113 | border-radius: 4px; 114 | line-height: 16px; 115 | font-size: 16px; 116 | font-weight: bold; 117 | width: 16px; 118 | height: 16px; 119 | text-align: center; 120 | float: right; 121 | cursor: pointer; 122 | } 123 | 124 | #popupbody { 125 | background-color: white; 126 | padding: 2px 5px 2px; 127 | border-radius: 0 0 3px 3px; 128 | max-height: 500px; 129 | overflow: auto; 130 | } 131 | 132 | /* identify result */ 133 | #popupbody table { 134 | margin-top: 5px; 135 | margin-bottom: 3px; 136 | width: 100%; 137 | } 138 | 139 | #popupbody table caption { 140 | background-color: gray; 141 | color: white; 142 | font-size: small; 143 | padding: 1px; 144 | padding-left: 6px; 145 | text-align: left; 146 | } 147 | 148 | #popupbody table td { 149 | padding-left: 5px; 150 | } 151 | 152 | #qr_layername_table tr { 153 | background-color: #eeeeee; 154 | } 155 | 156 | #qr_coords_table tr { 157 | background-color: #eeeeee; 158 | } 159 | 160 | #qr_attrs_table tr:nth-child(odd) { 161 | background-color: #eeeeee; 162 | } 163 | 164 | #qr_attrs_table tr td:first-child { 165 | width: 40%; 166 | } 167 | 168 | .action-btn { 169 | display: inline-block; 170 | border: 1px solid gray; 171 | border-radius: 2px; 172 | background-color: #FBFBFB; 173 | cursor: pointer; 174 | font-size: small; 175 | padding: 1px; 176 | margin-left: 2px; 177 | } 178 | 179 | .action-zoom { 180 | } 181 | 182 | .action-move { 183 | display: none; 184 | } 185 | 186 | /* pageinfo */ 187 | #pageinfo { 188 | font-size: small; 189 | } 190 | 191 | #pageinfo h1 { 192 | background-color: gray; 193 | color: white; 194 | font-size: small; 195 | font-weight: normal; 196 | margin-top: 5px; 197 | margin-bottom: 3px; 198 | padding: 1px; 199 | padding-left: 6px; 200 | } 201 | 202 | #urlbox { 203 | width: 100%; 204 | } 205 | 206 | #usage, #about { 207 | margin-left: 5px; 208 | } 209 | 210 | #usage tr:nth-child(odd) { 211 | background-color: #eeeeee; 212 | } 213 | 214 | #usage td.star { 215 | font-weight: bold; 216 | } 217 | 218 | #about ul { 219 | margin: 5px; 220 | margin-left: 20px; 221 | padding: 0px; 222 | } 223 | 224 | .license { 225 | font-size: xx-small; 226 | } 227 | 228 | .download-link { 229 | display: block; 230 | border: 1px solid darkgray; 231 | background: lightgray; 232 | color: black; 233 | font-size: large; 234 | margin: 10px 50px 10px; 235 | padding: 8px; 236 | text-align: center; 237 | text-decoration: none; 238 | } 239 | 240 | /* print dialog */ 241 | .print div { 242 | padding: 5px; 243 | } 244 | 245 | .print label { 246 | margin-left: 5px; 247 | } 248 | 249 | .print input[type="text"] { 250 | width: 40px; 251 | border: 1px solid lightgray; 252 | background: #F6F6F6; 253 | margin-left: 8px; 254 | margin-right: 8px; 255 | } 256 | 257 | .print input[type="checkbox"] { 258 | margin-left: 15px; 259 | } 260 | 261 | .print input[type="submit"] { 262 | display: none; 263 | } 264 | 265 | .print .buttonbox { 266 | text-align: center; 267 | padding-top: 10px; 268 | padding-bottom: 10px; 269 | } 270 | 271 | .print .buttonbox span { 272 | border: 1px solid darkgray; 273 | background: lightgray; 274 | margin: 0px 5px 0px; 275 | padding: 5px 10px 5px; 276 | cursor: pointer; 277 | } 278 | 279 | #northarrow { 280 | position: absolute; 281 | left: 12px; 282 | bottom: 16px; 283 | width: 80px; 284 | height: 80px; 285 | z-index: 1000; 286 | } 287 | -------------------------------------------------------------------------------- /resources/lb_shrimpgis_threejs_qgis/Qgis2threejs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/resources/lb_shrimpgis_threejs_qgis/Qgis2threejs.png -------------------------------------------------------------------------------- /resources/lb_shrimpgis_threejs_qgis/data/index/b0.bin: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /resources/lb_shrimpgis_threejs_qgis/data/index/b0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/resources/lb_shrimpgis_threejs_qgis/data/index/b0.png -------------------------------------------------------------------------------- /resources/lb_shrimpgis_threejs_qgis/data/index/scene.json: -------------------------------------------------------------------------------- 1 | {"type": "scene", "properties": {"height": 53.27793167128347, "width": 100.0, "baseExtent": [-7912406.63728884, 5213973.26036121, -7907468.824415551, 5216604.024929897], "crs": "EPSG:3857", "proj": "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs", "rotation": 0, "wgs84Center": {"lat": 42.36152316382997, "lon": -71.05617960058211}, "zExaggeration": 1.0, "zShift": 0.0}, "layers": [{"type": "layer", "id": 0, "properties": {"name": "mesh", "queryable": 1, "visible": true, "type": "polygon", "objType": "Polygon"}, "data": {"materials": [{"type": 0, "c": 4, "flat": 1, "ds": 1}, {"type": 0, "c": 11941497, "flat": 1, "ds": 1}, {"type": 0, "c": 7479169, "flat": 1, "ds": 1}, {"type": 0, "c": 2953567, "flat": 1, "ds": 1}, {"type": 0, "c": 16580031, "flat": 1, "ds": 1}, {"type": 0, "c": 16691063, "flat": 1, "ds": 1}, {"type": 0, "c": 15818845, "flat": 1, "ds": 1}], "blocks": [{"url": "./data/index/a0.json"}, {"url": "./data/index/a1.json"}, {"url": "./data/index/a2.json"}, {"url": "./data/index/a3.json"}, {"url": "./data/index/a4.json"}, {"url": "./data/index/a5.json"}, {"url": "./data/index/a6.json"}, {"url": "./data/index/a7.json"}, {"url": "./data/index/a8.json"}, {"url": "./data/index/a9.json"}, {"url": "./data/index/a10.json"}, {"url": "./data/index/a11.json"}, {"url": "./data/index/a12.json"}, {"url": "./data/index/a13.json"}, {"url": "./data/index/a14.json"}, {"url": "./data/index/a15.json"}, {"url": "./data/index/a16.json"}, {"url": "./data/index/a17.json"}, {"url": "./data/index/a18.json"}, {"url": "./data/index/a19.json"}, {"url": "./data/index/a20.json"}, {"url": "./data/index/a21.json"}, {"url": "./data/index/a22.json"}, {"url": "./data/index/a23.json"}, {"url": "./data/index/a24.json"}, {"url": "./data/index/a25.json"}, {"url": "./data/index/a26.json"}, {"url": "./data/index/a27.json"}, {"url": "./data/index/a28.json"}, {"url": "./data/index/a29.json"}, {"url": "./data/index/a30.json"}, {"url": "./data/index/a31.json"}, {"url": "./data/index/a32.json"}, {"url": "./data/index/a33.json"}, {"url": "./data/index/a34.json"}, {"url": "./data/index/a35.json"}, {"url": "./data/index/a36.json"}, {"url": "./data/index/a37.json"}, {"url": "./data/index/a38.json"}, {"url": "./data/index/a39.json"}, {"url": "./data/index/a40.json"}, {"url": "./data/index/a41.json"}, {"url": "./data/index/a42.json"}, {"url": "./data/index/a43.json"}, {"url": "./data/index/a44.json"}, {"url": "./data/index/a45.json"}, {"url": "./data/index/a46.json"}, {"url": "./data/index/a47.json"}, {"url": "./data/index/a48.json"}, {"url": "./data/index/a49.json"}, {"url": "./data/index/a50.json"}, {"url": "./data/index/a51.json"}, {"url": "./data/index/a52.json"}, {"url": "./data/index/a53.json"}, {"url": "./data/index/a54.json"}, {"url": "./data/index/a55.json"}, {"url": "./data/index/a56.json"}, {"url": "./data/index/a57.json"}, {"url": "./data/index/a58.json"}, {"url": "./data/index/a59.json"}, {"url": "./data/index/a60.json"}, {"url": "./data/index/a61.json"}, {"url": "./data/index/a62.json"}, {"url": "./data/index/a63.json"}, {"url": "./data/index/a64.json"}, {"url": "./data/index/a65.json"}]}}, {"type": "layer", "id": 1, "properties": {"name": "Flat Plane", "queryable": 1, "visible": true, "type": "dem", "shading": true}, "data": [{"type": "block", "layer": 1, "block": 0, "width": 100.0, "height": 53.27793167128347, "translate": [0.0, 0.0, 0.0], "zShift": 0.0, "zScale": 0.020251881261225638, "material": {"type": 0, "image": {"url": "./data/index/b0.png"}, "ds": 1}, "grid": {"width": 2, "height": 2, "url": "./data/index/b0.bin"}, "sides": {"mtl": {"type": 0, "c": 13417386}}}]}]} -------------------------------------------------------------------------------- /resources/lb_shrimpgis_threejs_qgis/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | index 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |
17 |
18 | 19 | 20 | 84 | 85 | 86 |
87 | 88 | 89 | 90 | 91 | 92 | 113 | 114 | 115 | -------------------------------------------------------------------------------- /resources/lb_shrimpgis_threejs_qgis/threejs/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright © 2010-2019 three.js authors 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /resources/shrimp_gis_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/resources/shrimp_gis_logo.png -------------------------------------------------------------------------------- /resources/wiki_img/1_1_qgis.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/resources/wiki_img/1_1_qgis.gif -------------------------------------------------------------------------------- /src/ShrimpGIS Curve.py: -------------------------------------------------------------------------------- 1 | # ShrimpGIS: A basic plugin to read and write shapefile (GPL). 2 | # This file is part of ShrimpGIS. 3 | # 4 | # Copyright (c) 2020, Antonello Di Nunzio . 5 | # You should have received a copy of the GNU General Public License 6 | # along with ShrimpGIS; If not, see . 7 | # 8 | # @license GPL-3.0+ 9 | 10 | """ 11 | Construct a ShrimpGIS Curve. 12 | Args: 13 | _surface: A Rhino or Grasshopper Curve to export. 14 | _location_: ShrimpGIS Location. 15 | _num_: Number of point to consider for discretization of curves. If it is a polyline component automatically recognizes points. 16 | - 17 | Default value is 10. 18 | 19 | Returns: 20 | shp_curve: ShrimpGIS Curve [plugin::type::n.point]. 21 | """ 22 | 23 | ghenv.Component.Name = "ShrimpGIS Curve" 24 | ghenv.Component.NickName = "shrimp_curve" 25 | ghenv.Component.Category = "ShrimpGIS" 26 | ghenv.Component.SubCategory = "0 || Settings" 27 | try: ghenv.Component.AdditionalHelpFromDocStrings = "2" 28 | except: pass 29 | 30 | import scriptcontext as sc 31 | import os 32 | import sys 33 | ##################ShrimpGIS##################### 34 | try: 35 | user_path = os.getenv("APPDATA") 36 | sys.path.append(user_path) 37 | from shrimp_gis import __version__ 38 | from shrimp_gis import Location 39 | from shrimp_gis.geometry import ShpCurve 40 | from shrimp_gis.io import get_latlon_from_location 41 | ghenv.Component.Message = __version__ 42 | except ImportError as e: 43 | raise ImportError("\nFailed to import ShrimpGIS: {0}\n\nCheck your 'shrimp_gis' folder in {1}".format(e, os.getenv("APPDATA"))) 44 | ################################################ 45 | 46 | import scriptcontext as sc 47 | import Grasshopper 48 | import Rhino 49 | 50 | warning = Grasshopper.Kernel.GH_RuntimeMessageLevel.Warning 51 | 52 | def is_in_meter(): 53 | units = sc.doc.ModelUnitSystem 54 | if `units` != 'Rhino.UnitSystem.Meters': return False 55 | return True 56 | 57 | def main(): 58 | 59 | if not is_in_meter(): 60 | ghenv.Component.AddRuntimeMessage(warning, "Rhino model have to be in meter.") 61 | return 62 | 63 | location = Location() if not _location_ else _location_ 64 | num = 10 if not _num_ else _num_ 65 | 66 | if _curve: 67 | shp_curve = [ShpCurve(crv, num) for crv in _curve] 68 | for geo in shp_curve: 69 | geo.coordinates = get_latlon_from_location(geo.points, location) 70 | 71 | return shp_curve 72 | 73 | shp_curve = main() 74 | -------------------------------------------------------------------------------- /src/ShrimpGIS CurveZ.py: -------------------------------------------------------------------------------- 1 | # ShrimpGIS: A basic plugin to read and write shapefile (GPL). 2 | # This file is part of ShrimpGIS. 3 | # 4 | # Copyright (c) 2020, Antonello Di Nunzio . 5 | # You should have received a copy of the GNU General Public License 6 | # along with ShrimpGIS; If not, see . 7 | # 8 | # @license GPL-3.0+ 9 | 10 | """ 11 | Construct a ShrimpGIS CurveZ. Use it if you have z values. 12 | Args: 13 | _surface: A Rhino or Grasshopper Curve to export. 14 | _location_: ShrimpGIS Location. 15 | _num_: Number of point to consider for discretization of curves. If it is a polyline component automatically recognizes points. 16 | - 17 | Default value is 10. 18 | 19 | Returns: 20 | shp_curve: ShrimpGIS Curve [plugin::type::n.point]. 21 | """ 22 | 23 | ghenv.Component.Name = "ShrimpGIS CurveZ" 24 | ghenv.Component.NickName = "shrimp_curvez" 25 | ghenv.Component.Category = "ShrimpGIS" 26 | ghenv.Component.SubCategory = "0 || Settings" 27 | try: ghenv.Component.AdditionalHelpFromDocStrings = "2" 28 | except: pass 29 | 30 | import scriptcontext as sc 31 | import os 32 | import sys 33 | ##################ShrimpGIS##################### 34 | try: 35 | user_path = os.getenv("APPDATA") 36 | sys.path.append(user_path) 37 | from shrimp_gis import __version__ 38 | from shrimp_gis import Location 39 | from shrimp_gis.geometry import ShpCurveZ 40 | from shrimp_gis.io import get_latlon_from_location 41 | ghenv.Component.Message = __version__ 42 | except ImportError as e: 43 | raise ImportError("\nFailed to import ShrimpGIS: {0}\n\nCheck your 'shrimp_gis' folder in {1}".format(e, os.getenv("APPDATA"))) 44 | ################################################ 45 | 46 | import scriptcontext as sc 47 | import Grasshopper 48 | import Rhino 49 | 50 | warning = Grasshopper.Kernel.GH_RuntimeMessageLevel.Warning 51 | 52 | def is_in_meter(): 53 | units = sc.doc.ModelUnitSystem 54 | if `units` != 'Rhino.UnitSystem.Meters': return False 55 | return True 56 | 57 | def main(): 58 | 59 | if not is_in_meter(): 60 | ghenv.Component.AddRuntimeMessage(warning, "Rhino model have to be in meter.") 61 | return 62 | 63 | location = Location() if not _location_ else _location_ 64 | num = 10 if not _num_ else _num_ 65 | 66 | if _curve: 67 | shp_curve = [ShpCurveZ(crv, num) for crv in _curve] 68 | for geo in shp_curve: 69 | geo.coordinates = get_latlon_from_location(geo.points, location, True) 70 | 71 | return shp_curve 72 | 73 | shp_curve = main() -------------------------------------------------------------------------------- /src/ShrimpGIS Decompose Field.py: -------------------------------------------------------------------------------- 1 | # ShrimpGIS: A basic plugin to read and write shapefile (GPL). 2 | # This file is part of ShrimpGIS. 3 | # 4 | # Copyright (c) 2020, Antonello Di Nunzio . 5 | # You should have received a copy of the GNU General Public License 6 | # along with ShrimpGIS; If not, see . 7 | # 8 | # @license GPL-3.0+ 9 | 10 | """ 11 | Use this component to decompose ShrimpGIS Field and extract values. 12 | 13 | input: 14 | _field: Column with rows that comes from "ShrimpGIS Field" or "ShrimpGIS Write Shp". 15 | output: 16 | read_me: Message for users. 17 | name: Name of column. 18 | values: Records (rows) associated to geometries. 19 | """ 20 | 21 | ghenv.Component.Name = "ShrimpGIS Decompose Field" 22 | ghenv.Component.NickName = "shrimp_dec_field" 23 | ghenv.Component.Category = "ShrimpGIS" 24 | ghenv.Component.SubCategory = "1 || IO" 25 | try: ghenv.Component.AdditionalHelpFromDocStrings = "2" 26 | except: pass 27 | 28 | import scriptcontext as sc 29 | import os 30 | import sys 31 | ##################ShrimpGIS##################### 32 | try: 33 | user_path = os.getenv("APPDATA") 34 | sys.path.append(user_path) 35 | from shrimp_gis import __version__ 36 | from shrimp_gis.io import ShpReader 37 | ghenv.Component.Message = __version__ 38 | except ImportError as e: 39 | raise ImportError("\nFailed to import ShrimpGIS: {0}\n\nCheck your 'shrimp_gis' folder in {1}".format(e, os.getenv("APPDATA"))) 40 | ################################################ 41 | 42 | def main(): 43 | 44 | return ShpReader.decompose_fields(_field) 45 | 46 | if (filter(None,_field)): 47 | values, name = main() 48 | -------------------------------------------------------------------------------- /src/ShrimpGIS Esri ASCII.py: -------------------------------------------------------------------------------- 1 | # ShrimpGIS: A basic plugin to read and write shapefile (GPL). 2 | # This file is part of ShrimpGIS. 3 | # 4 | # Copyright (c) 2020, Antonello Di Nunzio . 5 | # You should have received a copy of the GNU General Public License 6 | # along with ShrimpGIS; If not, see . 7 | # 8 | # @license GPL-3.0+ 9 | 10 | """ 11 | Construct a ShrimpGIS Matrix to write Esri ASCII Raster format. 12 | Args: 13 | _values: Values to map into a rectangular ASCII matrix [list]. 14 | - 15 | Values must be from left-right bottom-up. 16 | How does result should looks like (left-right bottom-up)? 17 | ... 18 | 5 6 7 8 9 19 | 0 1 2 3 4 20 | _num_x: Number of pixels at x [int]. 21 | _num_y: Number of pixels at y [int]. 22 | 23 | Returns: 24 | ASCII_matrix: ShrimpGIS Matrix. 25 | """ 26 | 27 | ghenv.Component.Name = "ShrimpGIS Esri ASCII" 28 | ghenv.Component.NickName = "shrimp_esri_ascii" 29 | ghenv.Component.Message = "1.0.0" 30 | ghenv.Component.Category = "ShrimpGIS" 31 | ghenv.Component.SubCategory = "0 || Settings" 32 | try: ghenv.Component.AdditionalHelpFromDocStrings = "1" 33 | except: pass 34 | 35 | import scriptcontext as sc 36 | import os 37 | import sys 38 | ##################ShrimpGIS##################### 39 | try: 40 | user_path = os.getenv("APPDATA") 41 | sys.path.append(user_path) 42 | from shrimp_gis import __version__ 43 | from shrimp_gis.geometry import Matrix 44 | 45 | ghenv.Component.Message = __version__ 46 | except ImportError as e: 47 | raise ImportError("\nFailed to import ShrimpGIS: {0}\n\nCheck your 'shrimp_gis' folder in {1}".format(e, os.getenv("APPDATA"))) 48 | ################################################ 49 | 50 | def main(): 51 | 52 | if _values and _num_x and _num_y: 53 | matrix = Matrix(_values, _num_x, _num_y) 54 | 55 | return matrix 56 | 57 | return None 58 | 59 | ASCII_matrix = main() 60 | 61 | 62 | -------------------------------------------------------------------------------- /src/ShrimpGIS Field.py: -------------------------------------------------------------------------------- 1 | # ShrimpGIS: A basic plugin to read and write shapefile (GPL). 2 | # This file is part of ShrimpGIS. 3 | # 4 | # Copyright (c) 2020, Antonello Di Nunzio . 5 | # You should have received a copy of the GNU General Public License 6 | # along with ShrimpGIS; If not, see . 7 | # 8 | # @license GPL-3.0+ 9 | 10 | """ 11 | Construct a ShrimpGIS Field. 12 | - 13 | Try to export data from other plugin, such as Ladybug and Gismo! 14 | Args: 15 | _type_: Type of key to write. Default value is 'C' (character). 16 | - 17 | 0 = Characters, text. 18 | 1 = Numbers, with or without decimals. 19 | 2 = Floats (same as "N"). 20 | 3 = Logical, for boolean values. Required input 0 or 1. 21 | 4 = Dates. Required input format YYYYMMDD. 22 | 5 = Memo, has no meaning within a GIS and is part of the xbase spec instead. 23 | key_: Name of column. Default value is 'MyField'. 24 | length_: Length of key. Default is 40. 25 | decimal_: Number of decimal places found in number key. 26 | _values: Records (rows) to export to shapefile. 27 | 28 | Returns: 29 | read_me: Message for users. 30 | field: Column with rows to write within shp file. 31 | """ 32 | 33 | ghenv.Component.Name = "ShrimpGIS Field" 34 | ghenv.Component.NickName = "shrimp_field" 35 | ghenv.Component.Category = "ShrimpGIS" 36 | ghenv.Component.SubCategory = "0 || Settings" 37 | try: ghenv.Component.AdditionalHelpFromDocStrings = "1" 38 | except: pass 39 | 40 | import scriptcontext as sc 41 | import os 42 | import sys 43 | ##################ShrimpGIS##################### 44 | try: 45 | user_path = os.getenv("APPDATA") 46 | sys.path.append(user_path) 47 | from shrimp_gis import __version__ 48 | from shrimp_gis import Field 49 | ghenv.Component.Message = __version__ 50 | except ImportError as e: 51 | raise ImportError("\nFailed to import ShrimpGIS: {0}\n\nCheck your 'shrimp_gis' folder in {1}".format(e, os.getenv("APPDATA"))) 52 | ################################################ 53 | 54 | def main(): 55 | 56 | if _values: 57 | 58 | field = Field(_values) 59 | 60 | if name_: field.name = name_ 61 | if _type_: field.type = Field.get_type(_type_) 62 | if length_: field.length = length_ 63 | if decimal_: field.decimal = decimal_ 64 | 65 | return field 66 | else: 67 | return 68 | 69 | field = main() 70 | if not field: print("Please, connect values.") 71 | -------------------------------------------------------------------------------- /src/ShrimpGIS Get UTM.py: -------------------------------------------------------------------------------- 1 | # ShrimpGIS: A basic plugin to read and write shapefile (GPL). 2 | # This file is part of ShrimpGIS. 3 | # 4 | # Copyright (c) 2020, Antonello Di Nunzio . 5 | # You should have received a copy of the GNU General Public License 6 | # along with ShrimpGIS; If not, see . 7 | # 8 | # @license GPL-3.0+ 9 | 10 | """ 11 | Get UTM information from Shrimp point. 12 | - 13 | The UTM (Universal Transverse Mercator) system divides the surface of the earth up into a grid. Each grid is identified by a number, a zone number and a letter. 14 | Args: 15 | _shp_point: Shrimp point. 16 | 17 | Returns: 18 | utm_easting: Easting value of UTM coordinate. 19 | utm_northing: Northing value of UTM coordinate. 20 | zone_number: UTM zone number. 21 | - 22 | The UTM system divides the Earth into 60 zones, each 6° of longitude in width. Zone 1 covers longitude 180° to 174° W. 23 | zone_letter: UTM zone letter. 24 | """ 25 | 26 | ghenv.Component.Name = "ShrimpGIS Get UTM" 27 | ghenv.Component.NickName = "shrimp_get_utm" 28 | ghenv.Component.Message = "1.0.0" 29 | ghenv.Component.Category = "ShrimpGIS" 30 | ghenv.Component.SubCategory = "2 || Utils" 31 | try: ghenv.Component.AdditionalHelpFromDocStrings = "1" 32 | except: pass 33 | 34 | import scriptcontext as sc 35 | import os 36 | import sys 37 | ##################ShrimpGIS##################### 38 | try: 39 | user_path = os.getenv("APPDATA") 40 | sys.path.append(user_path) 41 | from shrimp_gis import __version__ 42 | from shrimp_gis import Location 43 | from shrimp_gis.geometry import ShpPoint 44 | from shrimp_gis.io import get_utm_detail_from_location 45 | 46 | ghenv.Component.Message = __version__ 47 | except ImportError as e: 48 | raise ImportError("\nFailed to import ShrimpGIS: {0}\n\nCheck your 'shrimp_gis' folder in {1}".format(e, os.getenv("APPDATA"))) 49 | ################################################ 50 | 51 | def main(): 52 | 53 | if _shp_point: 54 | 55 | coordinates = _shp_point.coordinates[0] 56 | location = Location("ShrimpGIS-Location", coordinates[0], coordinates[1], _shp_point.points) 57 | 58 | return get_utm_detail_from_location(location) 59 | 60 | return None, None, None, None 61 | 62 | utm_easting, utm_northing, zone_number, zone_letter = main() 63 | 64 | 65 | -------------------------------------------------------------------------------- /src/ShrimpGIS Location.py: -------------------------------------------------------------------------------- 1 | # ShrimpGIS: A basic plugin to read and write shapefile (GPL). 2 | # This file is part of ShrimpGIS. 3 | # 4 | # Copyright (c) 2020, Antonello Di Nunzio . 5 | # You should have received a copy of the GNU General Public License 6 | # along with ShrimpGIS; If not, see . 7 | # 8 | # @license GPL-3.0+ 9 | 10 | """ 11 | Construct a ShrimpGIS Location. 12 | Args: 13 | _name_: Name of Location. 14 | _latitude_: Latitude of Location WGS84 [float]. 15 | _longitude_: Longitude of Location WGS84 [float]. 16 | _altitude_: Altitude of Location in meter [float]. Use it for shapefile with Z values. 17 | _anchor_point_: Rhino point to use as anchor point of Location. 18 | 19 | Returns: 20 | location: ShrimpGIS Location. 21 | """ 22 | 23 | ghenv.Component.Name = "ShrimpGIS Location" 24 | ghenv.Component.NickName = "shrimp_location" 25 | ghenv.Component.Message = "1.0.0" 26 | ghenv.Component.Category = "ShrimpGIS" 27 | ghenv.Component.SubCategory = "0 || Settings" 28 | try: ghenv.Component.AdditionalHelpFromDocStrings = "1" 29 | except: pass 30 | 31 | import scriptcontext as sc 32 | import os 33 | import sys 34 | ##################ShrimpGIS##################### 35 | try: 36 | user_path = os.getenv("APPDATA") 37 | sys.path.append(user_path) 38 | from shrimp_gis import __version__ 39 | from shrimp_gis import Location 40 | ghenv.Component.Message = __version__ 41 | except ImportError as e: 42 | raise ImportError("\nFailed to import ShrimpGIS: {0}\n\nCheck your 'shrimp_gis' folder in {1}".format(e, os.getenv("APPDATA"))) 43 | ################################################ 44 | 45 | def main(): 46 | 47 | location = Location() 48 | 49 | if _name_: location.name = _name_ 50 | if _latitude_: location.latitude = _latitude_ 51 | if _longitude_: location.longitude = _longitude_ 52 | if _altitude_: location.altitude = _altitude_ 53 | if _anchor_point_: location.anchor_point = _anchor_point_ 54 | 55 | return location 56 | 57 | location = main() -------------------------------------------------------------------------------- /src/ShrimpGIS Merge Geojson.py: -------------------------------------------------------------------------------- 1 | # ShrimpGIS: A basic plugin to read and write shapefile (GPL). 2 | # This file is part of ShrimpGIS. 3 | # 4 | # Copyright (c) 2020, Antonello Di Nunzio . 5 | # You should have received a copy of the GNU General Public License 6 | # along with ShrimpGIS; If not, see . 7 | # 8 | # @license GPL-3.0+ 9 | 10 | """ 11 | This is a special component that merges together geojson files with features into a new file. 12 | - 13 | It is very helpful if you work with separate and massive geojson and then you want to create just one file for them. 14 | E.g. a point layer with information about trees; a polygon layer with information about building and so on. 15 | Args: 16 | _geojson_file: geojson files to merge. 17 | - 18 | Standard rfc7946. Reference here: https://en.wikipedia.org/wiki/GeoJSON 19 | _folder: Path of directory where you want to save geojson file. For example, "C:\Example". 20 | _name_: Name of geojson which you want to save on your machine. Default name is "Geojson". 21 | run_it_: Set it to True to write geojson. 22 | 23 | Returns: 24 | read_me: Message for users. 25 | geojson_file: Complete path with extension of the new geojson. 26 | """ 27 | 28 | ghenv.Component.Name = "ShrimpGIS Merge Geojson" 29 | ghenv.Component.NickName = "shrimp_merge_geojson" 30 | ghenv.Component.Category = "ShrimpGIS" 31 | ghenv.Component.SubCategory = "1 || IO" 32 | try: ghenv.Component.AdditionalHelpFromDocStrings = "2" 33 | except: pass 34 | 35 | import scriptcontext as sc 36 | import os 37 | import sys 38 | import Grasshopper 39 | import Rhino 40 | 41 | ##################ShrimpGIS##################### 42 | try: 43 | user_path = os.getenv("APPDATA") 44 | sys.path.append(user_path) 45 | from shrimp_gis import __version__ 46 | from shrimp_gis.io import GeojsonWriter 47 | ghenv.Component.Message = __version__ 48 | except ImportError as e: 49 | raise ImportError("\nFailed to import ShrimpGIS: {0}\n\nCheck your 'shrimp_gis' folder in {1}".format(e, os.getenv("APPDATA"))) 50 | ################################################ 51 | 52 | warning = Grasshopper.Kernel.GH_RuntimeMessageLevel.Warning 53 | 54 | def main(): 55 | 56 | name = "Geojson" if _name_ == None else _name_ 57 | 58 | if (run_it_): 59 | result = GeojsonWriter.merge_geojson(_folder, name, _geojson_file) 60 | 61 | return result 62 | 63 | 64 | geojson_file = main() if _geojson_file and run_it_ and _folder != None else None 65 | if not geojson_file: 66 | print("Add _geojson_file and folder.\nThen set run_it to 'True'.") 67 | else: 68 | print("File written.") 69 | -------------------------------------------------------------------------------- /src/ShrimpGIS Mesh.py: -------------------------------------------------------------------------------- 1 | # ShrimpGIS: A basic plugin to read and write shapefile (GPL). 2 | # This file is part of ShrimpGIS. 3 | # 4 | # Copyright (c) 2020, Antonello Di Nunzio . 5 | # You should have received a copy of the GNU General Public License 6 | # along with ShrimpGIS; If not, see . 7 | # 8 | # @license GPL-3.0+ 9 | 10 | """ 11 | Construct a ShrimpGIS Mesh. 12 | - 13 | If you connect complex meshes exportation will look not really perfect. 14 | Args: 15 | _mesh: Rhino mesh. 16 | _location_: ShrimpGIS Location. 17 | 18 | Returns: 19 | shp_mesh: ShrimpGIS Mesh [plugin::type::n.triangle]. 20 | """ 21 | 22 | ghenv.Component.Name = "ShrimpGIS Mesh" 23 | ghenv.Component.NickName = "shrimp_mesh" 24 | ghenv.Component.Category = "ShrimpGIS" 25 | ghenv.Component.SubCategory = "0 || Settings" 26 | try: ghenv.Component.AdditionalHelpFromDocStrings = "2" 27 | except: pass 28 | 29 | import scriptcontext as sc 30 | import os 31 | import sys 32 | ##################ShrimpGIS##################### 33 | try: 34 | user_path = os.getenv("APPDATA") 35 | sys.path.append(user_path) 36 | from shrimp_gis import __version__ 37 | from shrimp_gis import Location 38 | from shrimp_gis.geometry import ShpMesh 39 | from shrimp_gis.io import get_latlon_from_location 40 | ghenv.Component.Message = __version__ 41 | except ImportError as e: 42 | raise ImportError("\nFailed to import ShrimpGIS: {0}\n\nCheck your 'shrimp_gis' folder in {1}".format(e, os.getenv("APPDATA"))) 43 | ################################################ 44 | 45 | import scriptcontext as sc 46 | import Grasshopper 47 | import Rhino 48 | 49 | warning = Grasshopper.Kernel.GH_RuntimeMessageLevel.Warning 50 | 51 | def is_in_meter(): 52 | units = sc.doc.ModelUnitSystem 53 | if `units` != 'Rhino.UnitSystem.Meters': return False 54 | return True 55 | 56 | def main(): 57 | 58 | if not is_in_meter(): 59 | ghenv.Component.AddRuntimeMessage(warning, "Rhino model have to be in meter.") 60 | return 61 | 62 | location = Location() if not _location_ else _location_ 63 | 64 | if _mesh: 65 | shp_mesh = [ShpMesh(m) for m in _mesh] 66 | for geo in shp_mesh: 67 | geo.coordinates = [] 68 | for pts in geo.points: 69 | geo.coordinates.append(get_latlon_from_location(pts, location)) 70 | 71 | return shp_mesh 72 | 73 | shp_mesh = main() 74 | -------------------------------------------------------------------------------- /src/ShrimpGIS Multigeometry.py: -------------------------------------------------------------------------------- 1 | # ShrimpGIS: A basic plugin to read and write shapefile (GPL). 2 | # This file is part of ShrimpGIS. 3 | # 4 | # Copyright (c) 2020, Antonello Di Nunzio . 5 | # You should have received a copy of the GNU General Public License 6 | # along with ShrimpGIS; If not, see . 7 | # 8 | # @license GPL-3.0+ 9 | 10 | """ 11 | Construct a ShrimpGIS MultiGeometry to use with geojson. It puts many geometry entities of the same family together. 12 | - 13 | REMARK: For Geojson only! 14 | Args: 15 | _shp_geometry: Connect a list of ShpCurves or ShpPoints or ShpSurfaces [list]. 16 | 17 | Returns: 18 | shp_multi: ShrimpGIS MultiGeometry [plugin::type("multi" + type)::n.geometries]. 19 | """ 20 | 21 | ghenv.Component.Name = "ShrimpGIS MultiGeometry" 22 | ghenv.Component.NickName = "shrimp_multi_geometry" 23 | ghenv.Component.Category = "ShrimpGIS" 24 | ghenv.Component.SubCategory = "0 || Settings" 25 | try: ghenv.Component.AdditionalHelpFromDocStrings = "3" 26 | except: pass 27 | 28 | import scriptcontext as sc 29 | import os 30 | import sys 31 | ##################ShrimpGIS##################### 32 | try: 33 | user_path = os.getenv("APPDATA") 34 | sys.path.append(user_path) 35 | from shrimp_gis import __version__ 36 | from shrimp_gis.geometry import MultiGeometry 37 | ghenv.Component.Message = __version__ 38 | except ImportError as e: 39 | raise ImportError("\nFailed to import ShrimpGIS: {0}\n\nCheck your 'shrimp_gis' folder in {1}".format(e, os.getenv("APPDATA"))) 40 | ################################################ 41 | 42 | import scriptcontext as sc 43 | import Grasshopper 44 | import Rhino 45 | 46 | warning = Grasshopper.Kernel.GH_RuntimeMessageLevel.Warning 47 | 48 | def is_in_meter(): 49 | units = sc.doc.ModelUnitSystem 50 | if `units` != 'Rhino.UnitSystem.Meters': return False 51 | return True 52 | 53 | def main(): 54 | 55 | if not is_in_meter(): 56 | ghenv.Component.AddRuntimeMessage(warning, "Rhino model have to be in meter.") 57 | return 58 | 59 | if _shp_geometry: 60 | shp_multi = MultiGeometry(_shp_geometry) 61 | 62 | return shp_multi 63 | 64 | shp_multi = main() 65 | -------------------------------------------------------------------------------- /src/ShrimpGIS Null List.py: -------------------------------------------------------------------------------- 1 | # ShrimpGIS: A basic plugin to read and write shapefile (GPL). 2 | # This file is part of ShrimpGIS. 3 | # 4 | # Copyright (c) 2020, Antonello Di Nunzio . 5 | # You should have received a copy of the GNU General Public License 6 | # along with ShrimpGIS; If not, see . 7 | # 8 | # @license GPL-3.0+ 9 | 10 | """ 11 | Utility to create NULL list. 12 | - 13 | Use it when you want to add NULL value to Shp Fields. 14 | Args: 15 | _number: Number of NULL values to create. 16 | 17 | Returns: 18 | null_list: List of NULL. 19 | """ 20 | 21 | ghenv.Component.Name = "ShrimpGIS Null List" 22 | ghenv.Component.NickName = "shrimp_null_list" 23 | ghenv.Component.Category = "ShrimpGIS" 24 | ghenv.Component.SubCategory = "0 || Utils" 25 | try: ghenv.Component.AdditionalHelpFromDocStrings = "1" 26 | except: pass 27 | 28 | import scriptcontext as sc 29 | import os 30 | import sys 31 | ##################ShrimpGIS##################### 32 | try: 33 | user_path = os.getenv("APPDATA") 34 | sys.path.append(user_path) 35 | from shrimp_gis import __version__ 36 | ghenv.Component.Message = __version__ 37 | except ImportError as e: 38 | raise ImportError("\nFailed to import ShrimpGIS: {0}\n\nCheck your 'shrimp_gis' folder in {1}".format(e, os.getenv("APPDATA"))) 39 | ################################################ 40 | 41 | def main(): 42 | 43 | if _number: 44 | 45 | return [None] * _number 46 | else: 47 | return 48 | 49 | null_list = main() 50 | -------------------------------------------------------------------------------- /src/ShrimpGIS Point.py: -------------------------------------------------------------------------------- 1 | # ShrimpGIS: A basic plugin to read and write shapefile (GPL). 2 | # This file is part of ShrimpGIS. 3 | # 4 | # Copyright (c) 2020, Antonello Di Nunzio . 5 | # You should have received a copy of the GNU General Public License 6 | # along with ShrimpGIS; If not, see . 7 | # 8 | # @license GPL-3.0+ 9 | 10 | """ 11 | Construct a ShrimpGIS Point. 12 | Args: 13 | _point: Rhino points. 14 | _location_: ShrimpGIS Location. 15 | 16 | Returns: 17 | shp_point: ShrimpGIS Point [plugin::type::n.point]. 18 | """ 19 | 20 | ghenv.Component.Name = "ShrimpGIS Point" 21 | ghenv.Component.NickName = "shrimp_point" 22 | ghenv.Component.Category = "ShrimpGIS" 23 | ghenv.Component.SubCategory = "0 || Settings" 24 | try: ghenv.Component.AdditionalHelpFromDocStrings = "2" 25 | except: pass 26 | 27 | import scriptcontext as sc 28 | import os 29 | import sys 30 | ##################ShrimpGIS##################### 31 | try: 32 | user_path = os.getenv("APPDATA") 33 | sys.path.append(user_path) 34 | from shrimp_gis import __version__ 35 | from shrimp_gis import Location 36 | from shrimp_gis.geometry import ShpPoint 37 | from shrimp_gis.io import get_latlon_from_location 38 | ghenv.Component.Message = __version__ 39 | except ImportError as e: 40 | raise ImportError("\nFailed to import ShrimpGIS: {0}\n\nCheck your 'shrimp_gis' folder in {1}".format(e, os.getenv("APPDATA"))) 41 | ################################################ 42 | 43 | import scriptcontext as sc 44 | import Grasshopper 45 | import Rhino 46 | 47 | warning = Grasshopper.Kernel.GH_RuntimeMessageLevel.Warning 48 | 49 | def is_in_meter(): 50 | units = sc.doc.ModelUnitSystem 51 | if `units` != 'Rhino.UnitSystem.Meters': return False 52 | return True 53 | 54 | def main(): 55 | 56 | if not is_in_meter(): 57 | ghenv.Component.AddRuntimeMessage(warning, "Rhino model have to be in meter.") 58 | return 59 | 60 | location = Location() if not _location_ else _location_ 61 | 62 | if _point: 63 | shp_point = [ShpPoint(pt) for pt in _point] 64 | for pt in shp_point: 65 | pt.coordinates = get_latlon_from_location([pt.geometry], location) 66 | 67 | return shp_point 68 | 69 | shp_point = main() 70 | -------------------------------------------------------------------------------- /src/ShrimpGIS PointZ.py: -------------------------------------------------------------------------------- 1 | # ShrimpGIS: A basic plugin to read and write shapefile (GPL). 2 | # This file is part of ShrimpGIS. 3 | # 4 | # Copyright (c) 2020, Antonello Di Nunzio . 5 | # You should have received a copy of the GNU General Public License 6 | # along with ShrimpGIS; If not, see . 7 | # 8 | # @license GPL-3.0+ 9 | 10 | """ 11 | Construct a ShrimpGIS PointZ. Use it if you have z values. 12 | Args: 13 | _point: Rhino points. 14 | _location_: ShrimpGIS Location. 15 | 16 | Returns: 17 | shp_point: ShrimpGIS Point [plugin::type::n.point]. 18 | """ 19 | 20 | ghenv.Component.Name = "ShrimpGIS PointZ" 21 | ghenv.Component.NickName = "shrimp_pointz" 22 | ghenv.Component.Category = "ShrimpGIS" 23 | ghenv.Component.SubCategory = "0 || Settings" 24 | try: ghenv.Component.AdditionalHelpFromDocStrings = "2" 25 | except: pass 26 | 27 | import scriptcontext as sc 28 | import os 29 | import sys 30 | ##################ShrimpGIS##################### 31 | try: 32 | user_path = os.getenv("APPDATA") 33 | sys.path.append(user_path) 34 | from shrimp_gis import __version__ 35 | from shrimp_gis import Location 36 | from shrimp_gis.geometry import ShpPointZ 37 | from shrimp_gis.io import get_latlon_from_location 38 | ghenv.Component.Message = __version__ 39 | except ImportError as e: 40 | raise ImportError("\nFailed to import ShrimpGIS: {0}\n\nCheck your 'shrimp_gis' folder in {1}".format(e, os.getenv("APPDATA"))) 41 | ################################################ 42 | 43 | import scriptcontext as sc 44 | import Grasshopper 45 | import Rhino 46 | 47 | warning = Grasshopper.Kernel.GH_RuntimeMessageLevel.Warning 48 | 49 | def is_in_meter(): 50 | units = sc.doc.ModelUnitSystem 51 | if `units` != 'Rhino.UnitSystem.Meters': return False 52 | return True 53 | 54 | def main(): 55 | 56 | if not is_in_meter(): 57 | ghenv.Component.AddRuntimeMessage(warning, "Rhino model have to be in meter.") 58 | return 59 | 60 | location = Location() if not _location_ else _location_ 61 | 62 | if _point: 63 | shp_point = [ShpPointZ(pt) for pt in _point] 64 | for pt in shp_point: 65 | pt.coordinates = get_latlon_from_location([pt.geometry], location, True) 66 | 67 | return shp_point 68 | 69 | shp_point = main() -------------------------------------------------------------------------------- /src/ShrimpGIS Polygon.py: -------------------------------------------------------------------------------- 1 | # ShrimpGIS: A basic plugin to read and write shapefile (GPL). 2 | # This file is part of ShrimpGIS. 3 | # 4 | # Copyright (c) 2020, Antonello Di Nunzio . 5 | # You should have received a copy of the GNU General Public License 6 | # along with ShrimpGIS; If not, see . 7 | # 8 | # @license GPL-3.0+ 9 | 10 | """ 11 | Construct a ShrimpGIS Polygon. 12 | Args: 13 | _surface: A Rhino or Grasshopper Brep/Surface to export. 14 | _location_: ShrimpGIS Location. 15 | _num_: Number of point to consider for discretization of curves. If it is a polyline component automatically recognizes points. 16 | - 17 | Default value is 10. 18 | 19 | Returns: 20 | shp_polygon: ShrimpGIS Polygon [plugin::type::n.polygon]. 21 | """ 22 | 23 | ghenv.Component.Name = "ShrimpGIS Polygon" 24 | ghenv.Component.NickName = "shrimp_polygon" 25 | ghenv.Component.Category = "ShrimpGIS" 26 | ghenv.Component.SubCategory = "0 || Settings" 27 | try: ghenv.Component.AdditionalHelpFromDocStrings = "2" 28 | except: pass 29 | 30 | import scriptcontext as sc 31 | import os 32 | import sys 33 | ##################ShrimpGIS##################### 34 | try: 35 | user_path = os.getenv("APPDATA") 36 | sys.path.append(user_path) 37 | from shrimp_gis import __version__ 38 | from shrimp_gis import Location 39 | from shrimp_gis.geometry import ShpPolygon 40 | from shrimp_gis.io import get_latlon_from_location 41 | ghenv.Component.Message = __version__ 42 | except ImportError as e: 43 | raise ImportError("\nFailed to import ShrimpGIS: {0}\n\nCheck your 'shrimp_gis' folder in {1}".format(e, os.getenv("APPDATA"))) 44 | ################################################ 45 | 46 | import scriptcontext as sc 47 | import Grasshopper 48 | import Rhino 49 | 50 | warning = Grasshopper.Kernel.GH_RuntimeMessageLevel.Warning 51 | 52 | def is_in_meter(): 53 | units = sc.doc.ModelUnitSystem 54 | if `units` != 'Rhino.UnitSystem.Meters': return False 55 | return True 56 | 57 | def main(): 58 | 59 | if not is_in_meter(): 60 | ghenv.Component.AddRuntimeMessage(warning, "Rhino model have to be in meter.") 61 | return 62 | 63 | location = Location() if not _location_ else _location_ 64 | num = 10 if not _num_ else _num_ 65 | 66 | if _surface: 67 | shp_polygon = [ShpPolygon(srf, num) for srf in _surface] 68 | for geo in shp_polygon: 69 | geo.coordinates = [] 70 | for pts in geo.points: 71 | geo.coordinates.append(get_latlon_from_location(pts, location)) 72 | 73 | return shp_polygon 74 | 75 | shp_polygon = main() 76 | -------------------------------------------------------------------------------- /src/ShrimpGIS PolygonZ.py: -------------------------------------------------------------------------------- 1 | # ShrimpGIS: A basic plugin to read and write shapefile (GPL). 2 | # This file is part of ShrimpGIS. 3 | # 4 | # Copyright (c) 2020, Antonello Di Nunzio . 5 | # You should have received a copy of the GNU General Public License 6 | # along with ShrimpGIS; If not, see . 7 | # 8 | # @license GPL-3.0+ 9 | 10 | """ 11 | Construct a ShrimpGIS PolygonZ. Use it if you have z values. 12 | Args: 13 | _surface: A Rhino or Grasshopper Brep/Surface to export. 14 | _location_: ShrimpGIS Location. 15 | _num_: Number of point to consider for discretization of curves. If it is a polyline component automatically recognizes points. 16 | - 17 | Default value is 10. 18 | 19 | Returns: 20 | shp_polygon: ShrimpGIS Polygon [plugin::type::n.polygon]. 21 | """ 22 | 23 | ghenv.Component.Name = "ShrimpGIS PolygonZ" 24 | ghenv.Component.NickName = "shrimp_polygonz" 25 | ghenv.Component.Category = "ShrimpGIS" 26 | ghenv.Component.SubCategory = "0 || Settings" 27 | try: ghenv.Component.AdditionalHelpFromDocStrings = "2" 28 | except: pass 29 | 30 | import scriptcontext as sc 31 | import os 32 | import sys 33 | ##################ShrimpGIS##################### 34 | try: 35 | user_path = os.getenv("APPDATA") 36 | sys.path.append(user_path) 37 | from shrimp_gis import __version__ 38 | from shrimp_gis import Location 39 | from shrimp_gis.geometry import ShpPolygonZ 40 | from shrimp_gis.io import get_latlon_from_location 41 | ghenv.Component.Message = __version__ 42 | except ImportError as e: 43 | raise ImportError("\nFailed to import ShrimpGIS: {0}\n\nCheck your 'shrimp_gis' folder in {1}".format(e, os.getenv("APPDATA"))) 44 | ################################################ 45 | 46 | import scriptcontext as sc 47 | import Grasshopper 48 | import Rhino 49 | 50 | warning = Grasshopper.Kernel.GH_RuntimeMessageLevel.Warning 51 | 52 | def is_in_meter(): 53 | units = sc.doc.ModelUnitSystem 54 | if `units` != 'Rhino.UnitSystem.Meters': return False 55 | return True 56 | 57 | def main(): 58 | 59 | if not is_in_meter(): 60 | ghenv.Component.AddRuntimeMessage(warning, "Rhino model have to be in meter.") 61 | return 62 | 63 | location = Location() if not _location_ else _location_ 64 | num = 10 if not _num_ else _num_ 65 | 66 | if _surface: 67 | shp_polygon = [ShpPolygonZ(srf, num) for srf in _surface] 68 | for geo in shp_polygon: 69 | geo.coordinates = [] 70 | for pts in geo.points: 71 | geo.coordinates.append(get_latlon_from_location(pts, location, True)) 72 | 73 | return shp_polygon 74 | 75 | shp_polygon = main() -------------------------------------------------------------------------------- /src/ShrimpGIS Read Geojson.py: -------------------------------------------------------------------------------- 1 | # ShrimpGIS: A basic plugin to read and write shapefile (GPL). 2 | # This file is part of ShrimpGIS. 3 | # 4 | # Copyright (c) 2020, Antonello Di Nunzio . 5 | # You should have received a copy of the GNU General Public License 6 | # along with ShrimpGIS; If not, see . 7 | # 8 | # @license GPL-3.0+ 9 | 10 | """ 11 | Use this component to read geojson file. 12 | - 13 | Supported geojson types are: 14 | 1) Point 15 | 2) MultiPoint 16 | 3) LineString 17 | 4) MultiLineString 18 | 5) Polygon 19 | 6) MultiPolygon 20 | - 21 | More info about geojson compliant structure supported by ShrimpGIS here: https://en.wikipedia.org/wiki/GeoJSON 22 | - 23 | Remark: Only WGS84 (EPSG:4326) reference system is supported. 24 | The coordinate reference system for all GeoJSON coordinates is a geographic coordinate reference system, using the World Geodetic System 1984 (WGS84) datum, with longitude and latitude units of decimal degrees. This is equivalent to the coordinate reference system identified by the Open Geospatial Consortium (OGC) URN urn:ogc:def:crs:OGC::CRS84. 25 | - 26 | reference: https://cran.r-project.org/web/packages/geojsonio/vignettes/geojson_spec.html 27 | Args: 28 | _geojson_file_: Complete path with extension of a geojson file. E.g. C:\Example\my_json.json 29 | - 30 | Note it supports geojson standard rfc7946. To see compatible structure see here: https://en.wikipedia.org/wiki/GeoJSON 31 | _location_: ShrimpGIS Location. 32 | run_it_: Set it to true to run component. 33 | Returns: 34 | read_me: Message for users. 35 | field: ShrimpGIS Fields attached to GIS geometries. 36 | type: Imported geojson type in Rhino world. 37 | - 38 | Note that a geojson file supports multiple geometry type at the same time. 39 | geometry: Imported geometries in Rhino world. 40 | """ 41 | 42 | ghenv.Component.Name = "ShrimpGIS Read Geojson" 43 | ghenv.Component.NickName = "shrimp_read_geojson" 44 | ghenv.Component.Category = "ShrimpGIS" 45 | ghenv.Component.SubCategory = "1 || IO" 46 | try: ghenv.Component.AdditionalHelpFromDocStrings = "1" 47 | except: pass 48 | 49 | import scriptcontext as sc 50 | import os 51 | import sys 52 | import Grasshopper 53 | import Rhino 54 | import System 55 | 56 | ##################ShrimpGIS##################### 57 | try: 58 | user_path = os.getenv("APPDATA") 59 | sys.path.append(user_path) 60 | from shrimp_gis import __version__, Location 61 | from shrimp_gis.io import GeojsonReader 62 | from shrimp_gis import Field 63 | ghenv.Component.Message = __version__ 64 | except ImportError as e: 65 | raise ImportError("\nFailed to import ShrimpGIS: {0}\n\nCheck your 'shrimp_gis' folder in {1}".format(e, os.getenv("APPDATA"))) 66 | ################################################ 67 | 68 | 69 | def main(): 70 | 71 | if run_it_: 72 | location = Location() if not _location_ else _location_ 73 | 74 | reader = GeojsonReader(_geojson_file_) 75 | geometry = reader.get_georeferenced_rhino_geometry(location) 76 | 77 | return reader.fields, reader.type, geometry 78 | return [None]*3 79 | 80 | field, type, geometry = main() 81 | -------------------------------------------------------------------------------- /src/ShrimpGIS Read Shp.py: -------------------------------------------------------------------------------- 1 | # ShrimpGIS: A basic plugin to read and write shapefile (GPL). 2 | # This file is part of ShrimpGIS. 3 | # 4 | # Copyright (c) 2020, Antonello Di Nunzio . 5 | # You should have received a copy of the GNU General Public License 6 | # along with ShrimpGIS; If not, see . 7 | # 8 | # @license GPL-3.0+ 9 | 10 | """ 11 | Use this component to read shapefiles. 12 | - 13 | Supported shapefile types are: 14 | 1) POINT 15 | 2) POLYLINE 16 | 3) POLYGON 17 | 4) POINTZ 18 | 5) POLYLINEZ 19 | 6) POLYGONZ 20 | - 21 | Remark: Only WGS84 (EPSG:4326) reference system is supported. 22 | If your shp use another coordinate system you have to reproject it using a GIS software (e.g. QGIS). 23 | 24 | Args: 25 | _shp_file: Complete path with extension of a shapefile. E.g. C:\Example\shapefile.shp 26 | _location_: ShrimpGIS Location. 27 | run_it_: Set it to true to run component. 28 | Returns: 29 | read_me: Message for users. 30 | field: ShrimpGIS Fields attached to GIS geometries. 31 | geometry: Imported geometries in Rhino world. 32 | - 33 | They are arranged in GH tree in "Maintain" mode. Branches of missing geometries are deleted automatically. 34 | -------------------: 35 | missing_geometry: Some geometries can be not import correctly. Here you can find Id of missing geometries. 36 | - 37 | Use this output to create Paths or use it as List to clear Field values from missing geometries. 38 | """ 39 | 40 | ghenv.Component.Name = "ShrimpGIS Read Shp" 41 | ghenv.Component.NickName = "shrimp_read_shp" 42 | ghenv.Component.Category = "ShrimpGIS" 43 | ghenv.Component.SubCategory = "1 || IO" 44 | try: ghenv.Component.AdditionalHelpFromDocStrings = "1" 45 | except: pass 46 | 47 | import scriptcontext as sc 48 | import os 49 | import sys 50 | import Grasshopper 51 | import Rhino 52 | 53 | ##################ShrimpGIS##################### 54 | try: 55 | user_path = os.getenv("APPDATA") 56 | sys.path.append(user_path) 57 | from shrimp_gis import __version__, Location 58 | from shrimp_gis.io import ShpReader 59 | from shrimp_gis.io import from_nested_lat_lon_to_utm 60 | ghenv.Component.Message = __version__ 61 | except ImportError as e: 62 | raise ImportError("\nFailed to import ShrimpGIS: {0}\n\nCheck your 'shrimp_gis' folder in {1}".format(e, os.getenv("APPDATA"))) 63 | ################################################ 64 | 65 | 66 | def main(): 67 | 68 | level = Grasshopper.Kernel.GH_RuntimeMessageLevel.Remark 69 | 70 | if not _shp_file: 71 | print("Connect a compatible shapefile to read.\nThen set run_it to 'True'.") 72 | return [None]*3 73 | 74 | location = Location() if not _location_ else _location_ 75 | 76 | if run_it_: 77 | 78 | reader = ShpReader(_shp_file) 79 | 80 | if (reader.level == "not supported"): 81 | ghenv.Component.AddRuntimeMessage(level, "I am Sorry, {0} file type is not supported" \ 82 | " by shp reader components.".format(reader.type_name)) 83 | return [None]*3 84 | else: 85 | gh_points = from_nested_lat_lon_to_utm(reader.points, location) 86 | 87 | if (reader.level == "supported with z"): 88 | ghenv.Component.AddRuntimeMessage(level, "{0} file type supported." \ 89 | " This shp file has Z values.".format(reader.type_name)) 90 | 91 | for pts, zs in zip(gh_points, reader.z): 92 | for pt, z in zip(pts, zs): 93 | pt.Z = z - location.altitude 94 | 95 | geometry, missing_geometry = reader.get_georeferenced_rhino_geometry(gh_points) 96 | field = reader.fields 97 | 98 | return field, geometry, missing_geometry 99 | 100 | else: 101 | return [None]*3 102 | 103 | field, geometry, missing_geometry = main() 104 | 105 | -------------------------------------------------------------------------------- /src/ShrimpGIS UTM PRJ.py: -------------------------------------------------------------------------------- 1 | # ShrimpGIS: A basic plugin to read and write shapefile (GPL). 2 | # This file is part of ShrimpGIS. 3 | # 4 | # Copyright (c) 2020, Antonello Di Nunzio . 5 | # You should have received a copy of the GNU General Public License 6 | # along with ShrimpGIS; If not, see . 7 | # 8 | # @license GPL-3.0+ 9 | 10 | """ 11 | Get EPSG code and *.prj content for a specific Shrimp point. Use it with 'ShrimpGIS Write Asc'. 12 | - 13 | This component uses internet connection. It retrieves PROJCS string of UTM (datum WGS84). 14 | - 15 | EPSG code is an ID between 1024-32767 which is part of a public registry of spatial reference systems (EPSG registry). 16 | PRJ file contains the projected coordinate system you are referring to. It is an important file to map correctly raster file as well vector files. 17 | Args: 18 | _shp_point: Shrimp point to use to get UTM projection reference system. 19 | 20 | Returns: 21 | EPSG: EPSG code. 22 | prj_text: Text to write into a *.prj file. Connect it to 'ShrimpGIS Write Asc'. 23 | """ 24 | 25 | ghenv.Component.Name = "ShrimpGIS UTM PRJ" 26 | ghenv.Component.NickName = "shrimp_utm_prj" 27 | ghenv.Component.Message = "1.0.0" 28 | ghenv.Component.Category = "ShrimpGIS" 29 | ghenv.Component.SubCategory = "2 || Utils" 30 | try: ghenv.Component.AdditionalHelpFromDocStrings = "1" 31 | except: pass 32 | 33 | import scriptcontext as sc 34 | import os 35 | import sys 36 | ##################ShrimpGIS##################### 37 | try: 38 | user_path = os.getenv("APPDATA") 39 | sys.path.append(user_path) 40 | from shrimp_gis import __version__ 41 | from shrimp_gis.io import get_epsg_from_shp_point, get_prj_text_from_EPSG 42 | 43 | ghenv.Component.Message = __version__ 44 | except ImportError as e: 45 | raise ImportError("\nFailed to import ShrimpGIS: {0}\n\nCheck your 'shrimp_gis' folder in {1}".format(e, os.getenv("APPDATA"))) 46 | ################################################ 47 | 48 | def main(): 49 | 50 | if _shp_point: 51 | EPSG = get_epsg_from_shp_point(_shp_point) 52 | prj_text = get_prj_text_from_EPSG(EPSG) 53 | 54 | return EPSG, prj_text 55 | return None, None 56 | 57 | EPSG, prj_text = main() 58 | 59 | 60 | -------------------------------------------------------------------------------- /src/ShrimpGIS Write Asc.py: -------------------------------------------------------------------------------- 1 | # ShrimpGIS: A basic plugin to read and write shapefile (GPL). 2 | # This file is part of ShrimpGIS. 3 | # 4 | # Copyright (c) 2020, Antonello Di Nunzio . 5 | # You should have received a copy of the GNU General Public License 6 | # along with ShrimpGIS; If not, see . 7 | # 8 | # @license GPL-3.0+ 9 | 10 | """ 11 | It writes Esri ASCII Raster. 12 | - 13 | It is a raster format file you can open with QGIS, for example. 14 | Args: 15 | _ASCII_matrix: ShrimpGIS ASCII matrix. 16 | _pixel_size: Dimension (Length or Width) in meter of pixel [float]. 17 | _utm_easting: Easting value of UTM coordinate [float]. 18 | _utm_northing: Northing value of UTM coordinate [float]. 19 | _prj_text: Text to write into *.prj file. Connect output of 'ShrimpGIS UTM PRJ'. 20 | _folder: Path of directory where you want to save asc file. For example, "C:\Example". 21 | _name_: Name of asc which you want to save on your machine. Default name is 'shrimp_gis_asc'. 22 | run_it_: Set it to True to write asc file. 23 | 24 | Returns: 25 | read_me: Message for users. 26 | asc_file: Complete path with extension of the raster file. 27 | """ 28 | 29 | ghenv.Component.Name = "ShrimpGIS Write Asc" 30 | ghenv.Component.NickName = "shrimp_write_asc" 31 | ghenv.Component.Message = "1.0.0" 32 | ghenv.Component.Category = "ShrimpGIS" 33 | ghenv.Component.SubCategory = "1 || IO" 34 | try: ghenv.Component.AdditionalHelpFromDocStrings = "1" 35 | except: pass 36 | 37 | import scriptcontext as sc 38 | import os 39 | import sys 40 | ##################ShrimpGIS##################### 41 | try: 42 | user_path = os.getenv("APPDATA") 43 | sys.path.append(user_path) 44 | from shrimp_gis import __version__ 45 | from shrimp_gis.io import AscWriter 46 | 47 | ghenv.Component.Message = __version__ 48 | except ImportError as e: 49 | raise ImportError("\nFailed to import ShrimpGIS: {0}\n\nCheck your 'shrimp_gis' folder in {1}".format(e, os.getenv("APPDATA"))) 50 | ################################################ 51 | 52 | 53 | def main(): 54 | 55 | name = "shrimp_gis_asc" if _name_ == None else _name_ 56 | 57 | if _ASCII_matrix and _pixel_size and _utm_easting and _utm_northing and _prj_text and _folder and run_it_: 58 | 59 | asc_file = AscWriter(_ASCII_matrix, _pixel_size, _utm_easting, _utm_northing) 60 | file = asc_file.get_asc(_folder, name, _prj_text) 61 | 62 | return file 63 | 64 | return 65 | 66 | asc_file = main() 67 | if not asc_file: print("Please, connect _ASCII_matrix, _pixel_size, _utm_easting, _utm_northing, _prj_text, _folder and set run_it_ to 'True'.") 68 | 69 | 70 | -------------------------------------------------------------------------------- /src/ShrimpGIS Write Geojson.py: -------------------------------------------------------------------------------- 1 | # ShrimpGIS: A basic plugin to read and write shapefile (GPL). 2 | # This file is part of ShrimpGIS. 3 | # 4 | # Copyright (c) 2020, Antonello Di Nunzio . 5 | # You should have received a copy of the GNU General Public License 6 | # along with ShrimpGIS; If not, see . 7 | # 8 | # @license GPL-3.0+ 9 | 10 | """ 11 | It writes Geojson file - standard rfc7946. 12 | - 13 | More info about geojson compliant structure supported by ShrimpGIS here: https://en.wikipedia.org/wiki/GeoJSON 14 | Args: 15 | _field_: ShrimpGIS Fields to add to GIS geometries. 16 | - 17 | If nothing is added to this input, it will create just one column called UUID. 18 | _shp_geometry: Geometry to write into shapefile. 19 | - 20 | Connect following 21 | - ShrimpGIS point 22 | - ShrimpGIS curve 23 | - ShrimpGIS polygon 24 | - 25 | Note that Geojson supports many types at the same time. You can do that. 26 | OR 27 | If you want to manage different fields, you can create multiple geojson and merge them together with "ShrimpGIS Merge Geojson". 28 | _folder: Path of directory where you want to save a geojson. For example, "C:\Example". 29 | _name_: Name of geojson which you want to save on your machine. Default name is the first . 30 | run_it_: Set it to True to write geojson. 31 | 32 | Returns: 33 | read_me: Message for users. 34 | geojson_file: Complete path with extension of the geojson. 35 | """ 36 | 37 | ghenv.Component.Name = "ShrimpGIS Write Geojson" 38 | ghenv.Component.NickName = "shrimp_write_geojson" 39 | ghenv.Component.Category = "ShrimpGIS" 40 | ghenv.Component.SubCategory = "1 || IO" 41 | try: ghenv.Component.AdditionalHelpFromDocStrings = "1" 42 | except: pass 43 | 44 | import scriptcontext as sc 45 | import os 46 | import sys 47 | import Grasshopper 48 | import Rhino 49 | 50 | ##################ShrimpGIS##################### 51 | try: 52 | user_path = os.getenv("APPDATA") 53 | sys.path.append(user_path) 54 | from shrimp_gis import __version__ 55 | from shrimp_gis.io import GeojsonWriter 56 | ghenv.Component.Message = __version__ 57 | except ImportError as e: 58 | raise ImportError("\nFailed to import ShrimpGIS: {0}\n\nCheck your 'shrimp_gis' folder in {1}".format(e, os.getenv("APPDATA"))) 59 | ################################################ 60 | 61 | warning = Grasshopper.Kernel.GH_RuntimeMessageLevel.Warning 62 | 63 | def main(): 64 | 65 | main_type = _shp_geometry[0].name 66 | 67 | name = main_type if _name_ == None else _name_ 68 | 69 | if None in _field_: print("There is an invalid field."); return 70 | 71 | if (run_it_): 72 | shp_write = GeojsonWriter() 73 | result = shp_write.write_geojson_file(_folder, name, _shp_geometry, _field_) 74 | 75 | if result == False: 76 | ghenv.Component.AddRuntimeMessage(warning, "Please make sure value of fields are equals to geometries count.") 77 | else: 78 | return result 79 | 80 | 81 | geojson_file = main() if _shp_geometry and run_it_ and _folder != None else None 82 | if not geojson_file: 83 | print("Add shp_geometry and folder.\nThen set run_it to 'True'.") 84 | else: 85 | print("File written.") 86 | -------------------------------------------------------------------------------- /src/ShrimpGIS Write Shp.py: -------------------------------------------------------------------------------- 1 | # ShrimpGIS: A basic plugin to read and write shapefile (GPL). 2 | # This file is part of ShrimpGIS. 3 | # 4 | # Copyright (c) 2020, Antonello Di Nunzio . 5 | # You should have received a copy of the GNU General Public License 6 | # along with ShrimpGIS; If not, see . 7 | # 8 | # @license GPL-3.0+ 9 | 10 | """ 11 | Use this component to read shapefiles. 12 | - 13 | Supported shapefile types are: 14 | 1) POINT 15 | 2) POLYLINE 16 | 3) POLYGON 17 | 4) POINTZ 18 | 5) POLYLINEZ 19 | 6) POLYGONZ 20 | - 21 | Remark: Only WGS84 (EPSG:4326) reference system is supported. 22 | If your shp use another coordinate system you have to reproject it using a GIS software (e.g. QGIS). 23 | 24 | Args: 25 | _shp_file: Complete path with extension of a shapefile. E.g. C:\Example\shapefile.shp 26 | _location_: ShrimpGIS Location. 27 | run_it_: Set it to true to run component. 28 | Returns: 29 | read_me: Message for users. 30 | field: ShrimpGIS Fields attached to GIS geometries. 31 | geometry: Imported geometries in Rhino world. 32 | - 33 | They are arranged in GH tree in "Maintain" mode. Branches of missing geometries are deleted automatically. 34 | -------------------: 35 | missing_geometry: Some geometries can be not import correctly. Here you can find Id of missing geometries. 36 | - 37 | Use this output to create Paths or use it as List to clear Field values from missing geometries. 38 | """ 39 | 40 | ghenv.Component.Name = "ShrimpGIS Read Shp" 41 | ghenv.Component.NickName = "shrimp_read_shp" 42 | ghenv.Component.Category = "ShrimpGIS" 43 | ghenv.Component.SubCategory = "1 || IO" 44 | try: ghenv.Component.AdditionalHelpFromDocStrings = "1" 45 | except: pass 46 | 47 | import scriptcontext as sc 48 | import os 49 | import sys 50 | import Grasshopper 51 | import Rhino 52 | 53 | ##################ShrimpGIS##################### 54 | try: 55 | user_path = os.getenv("APPDATA") 56 | sys.path.append(user_path) 57 | from shrimp_gis import __version__, Location 58 | from shrimp_gis.io import ShpReader 59 | from shrimp_gis.io import from_nested_lat_lon_to_utm 60 | ghenv.Component.Message = __version__ 61 | except ImportError as e: 62 | raise ImportError("\nFailed to import ShrimpGIS: {0}\n\nCheck your 'shrimp_gis' folder in {1}".format(e, os.getenv("APPDATA"))) 63 | ################################################ 64 | 65 | 66 | def main(): 67 | 68 | level = Grasshopper.Kernel.GH_RuntimeMessageLevel.Remark 69 | 70 | if not _shp_file: 71 | print("Connect a compatible shapefile to read.\nThen set run_it to 'True'.") 72 | return [None]*3 73 | 74 | location = Location() if not _location_ else _location_ 75 | 76 | if run_it_: 77 | 78 | reader = ShpReader(_shp_file) 79 | 80 | if (reader.level == "not supported"): 81 | ghenv.Component.AddRuntimeMessage(level, "I am Sorry, {0} file type is not supported" \ 82 | " by shp reader components.".format(reader.type_name)) 83 | return [None]*3 84 | else: 85 | gh_points = from_nested_lat_lon_to_utm(reader.points, location) 86 | 87 | if (reader.level == "supported with z"): 88 | ghenv.Component.AddRuntimeMessage(level, "{0} file type supported." \ 89 | " This shp file has Z values.".format(reader.type_name)) 90 | 91 | for pts, zs in zip(gh_points, reader.z): 92 | for pt, z in zip(pts, zs): 93 | pt.Z = z - location.altitude 94 | 95 | geometry, missing_geometry = reader.get_georeferenced_rhino_geometry(gh_points) 96 | field = reader.fields 97 | 98 | return field, geometry, missing_geometry 99 | 100 | else: 101 | return [None]*3 102 | 103 | field, geometry, missing_geometry = main() 104 | 105 | -------------------------------------------------------------------------------- /user_objects/ShrimpGIS Curve.ghuser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/user_objects/ShrimpGIS Curve.ghuser -------------------------------------------------------------------------------- /user_objects/ShrimpGIS CurveZ.ghuser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/user_objects/ShrimpGIS CurveZ.ghuser -------------------------------------------------------------------------------- /user_objects/ShrimpGIS Decompose Field.ghuser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/user_objects/ShrimpGIS Decompose Field.ghuser -------------------------------------------------------------------------------- /user_objects/ShrimpGIS Esri ASCII.ghuser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/user_objects/ShrimpGIS Esri ASCII.ghuser -------------------------------------------------------------------------------- /user_objects/ShrimpGIS Field.ghuser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/user_objects/ShrimpGIS Field.ghuser -------------------------------------------------------------------------------- /user_objects/ShrimpGIS Get UTM.ghuser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/user_objects/ShrimpGIS Get UTM.ghuser -------------------------------------------------------------------------------- /user_objects/ShrimpGIS Location.ghuser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/user_objects/ShrimpGIS Location.ghuser -------------------------------------------------------------------------------- /user_objects/ShrimpGIS Merge Geojson.ghuser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/user_objects/ShrimpGIS Merge Geojson.ghuser -------------------------------------------------------------------------------- /user_objects/ShrimpGIS Mesh.ghuser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/user_objects/ShrimpGIS Mesh.ghuser -------------------------------------------------------------------------------- /user_objects/ShrimpGIS MultiGeometry.ghuser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/user_objects/ShrimpGIS MultiGeometry.ghuser -------------------------------------------------------------------------------- /user_objects/ShrimpGIS Null List.ghuser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/user_objects/ShrimpGIS Null List.ghuser -------------------------------------------------------------------------------- /user_objects/ShrimpGIS Point.ghuser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/user_objects/ShrimpGIS Point.ghuser -------------------------------------------------------------------------------- /user_objects/ShrimpGIS PointZ.ghuser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/user_objects/ShrimpGIS PointZ.ghuser -------------------------------------------------------------------------------- /user_objects/ShrimpGIS Polygon.ghuser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/user_objects/ShrimpGIS Polygon.ghuser -------------------------------------------------------------------------------- /user_objects/ShrimpGIS PolygonZ.ghuser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/user_objects/ShrimpGIS PolygonZ.ghuser -------------------------------------------------------------------------------- /user_objects/ShrimpGIS Read Geojson.ghuser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/user_objects/ShrimpGIS Read Geojson.ghuser -------------------------------------------------------------------------------- /user_objects/ShrimpGIS Read Shp.ghuser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/user_objects/ShrimpGIS Read Shp.ghuser -------------------------------------------------------------------------------- /user_objects/ShrimpGIS UTM PRJ.ghuser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/user_objects/ShrimpGIS UTM PRJ.ghuser -------------------------------------------------------------------------------- /user_objects/ShrimpGIS Write Asc.ghuser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/user_objects/ShrimpGIS Write Asc.ghuser -------------------------------------------------------------------------------- /user_objects/ShrimpGIS Write Geojson.ghuser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/user_objects/ShrimpGIS Write Geojson.ghuser -------------------------------------------------------------------------------- /user_objects/ShrimpGIS Write Shp.ghuser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AntonelloDN/ShrimpGIS/cb74a8e1be14c854c7d0e88d4557f77f4c507a18/user_objects/ShrimpGIS Write Shp.ghuser --------------------------------------------------------------------------------