Skip to content

Commit

Permalink
2.19 release_to_MAIN (#196)
Browse files Browse the repository at this point in the history
2.19 updates:
add GisFeature class
speed up raster conversions
simplify large polygon display Meshes on Send
specify QGIS max version
generate installers for Mac (we had it already, just needed a change in CI)


* add Gis feature class on send and receive (#195)

* send GisFeature

* remove display val from child geometries

* receive GisFeature

* fix

* ensure units are strings

* fix failing test

* qgis max version (#194)

* raster conversion speed (#193)

* draft based on c# (adjust offset/rotation; XY directions)

* speed up, no offset

* to test, add correction XY

* fixed

* final fixes

* move function out

* non-negative scale and dimensions

* more optimized renderers, fixed "correction" for rasters

* remove specklepy call in helpers

* Revert "remove specklepy call in helpers"

This reverts commit de002e0.

* rely on string type for dataStorage.currentUnits

* fix units format

* standardize WKT format (#197)

* updato to m1 resource on CI, aligned with specklesystems/speckle-sharp#3449 (no rosetta) (#204)

* raster renderer edge cases (#206)

* simplify and triangulate large meshes (#201)

* simplify and triangulate large meshes

* more clear logic with adding points

* apply coeff to inner rings

* fix indexError

* max pts

* updated links

* tags

* remove extra readme

* syntax error
  • Loading branch information
KatKatKateryna authored Jul 1, 2024
1 parent 8463c82 commit 16affa5
Show file tree
Hide file tree
Showing 15 changed files with 1,030 additions and 858 deletions.
7 changes: 5 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ orbs:
# Upload artifacts to s3
aws-s3: circleci/aws-s3@2.0.0
codecov: codecov/codecov@3.3.0
macos: circleci/macos@2.4.1

jobs:

Expand Down Expand Up @@ -83,9 +84,10 @@ jobs:
VERSION=$(echo "$SEMVER" | sed -e 's/[a-zA-Z]*\///')
python patch_version.py $VERSION
- run:
name: Remove extra License
name: Remove extra License and Readme
command: |
rm ./specklepy_qt_ui/LICENSE
rm ./specklepy_qt_ui/qt_ui/README.md
- run:
name: ZIP plugin
command: pb_tool zip
Expand Down Expand Up @@ -213,7 +215,8 @@ jobs:

build-installer-mac:
macos:
xcode: 12.5.1
xcode: 13.4.1
resource_class: macos.m1.medium.gen1
parameters:
runtime:
type: string
Expand Down
7 changes: 4 additions & 3 deletions metadata.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
[general]
name=Speckle
qgisMinimumVersion=3.28.15
qgisMaximumVersion=3.34.3
description=Speckle 2.0 Connector for QGIS
version=0.0.99
author=Speckle Systems
Expand All @@ -14,11 +15,11 @@ about=
The Speckle QGIS plugin allows you send and receive data from multiple sources to/from several layers in your project, and store their geometry (as well as their contained metadata), in a Speckle server.

Don't know what Speckle is? You're not alone! Find out more at https://speckle.systems
You can start exploring by checking out this commit generated in QGIS from open web data sources (OSM, Google Satellite Tiles and Mapzen Terrain Tiles): https://speckle.xyz/streams/5feae56049/commits/b5f4cc5f3b
You can start exploring by checking out this commit generated in QGIS from open web data sources (OSM, Google Satellite Tiles and Mapzen Terrain Tiles): https://app.speckle.systems/projects/5feae56049/models/1a95ec93ec

Requirements:
- Speckle Manager: You can download the installer here -> https://speckle.guide/user/manager
- An account in a Speckle server. If you don't have one, feel free to use our public server https://speckle.xyz
- An account in a Speckle server. If you don't have one, feel free to use our public server https://app.speckle.systems/
- An account added in the Accounts section of the Speckle Manager
- Windows and Mac compatible

Expand Down Expand Up @@ -48,7 +49,7 @@ hasProcessingProvider=no
# changelog=

# Tags are comma separated with spaces allowed
tags=python, speckle, interoperability, collaboration, bim, cad
tags=python, speckle, interoperability, collaboration, 3d, bim, cad, online, server, web, cloud

homepage=http://speckle.systems
category=Web
Expand Down
47 changes: 9 additions & 38 deletions plugin_utils/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
import inspect
from difflib import SequenceMatcher

from specklepy.objects.units import get_units_from_string
from specklepy.objects.units import get_scale_factor_to_meters

SYMBOL = "_x_x_"
UNSUPPORTED_PROVIDERS = ["WFS", "wms", "wcs", "vectortile"]

Expand All @@ -31,57 +34,25 @@ def get_scale_factor(units: str, dataStorage) -> float:
return scale_to_meter


def get_scale_factor_to_meter(units: str) -> float:
def get_scale_factor_to_meter(units_src: str) -> float:
try:
unit_scale = {
"meters": 1.0,
"centimeters": 0.01,
"millimeters": 0.001,
"inches": 0.0254,
"feet": 0.3048,
"kilometers": 1000.0,
"mm": 0.001,
"cm": 0.01,
"m": 1.0,
"km": 1000.0,
"in": 0.0254,
"ft": 0.3048,
"yd": 0.9144,
"mi": 1609.340,
}
if (
units is not None
and isinstance(units, str)
and units.lower() in unit_scale.keys()
):
return unit_scale[units]
units = get_units_from_string(units_src)
return get_scale_factor_to_meters(units)
except:
try:
from speckle.utils.panel_logging import logToUser

logToUser(
f"Units {units} are not supported. Meters will be applied by default.",
f"Units {units_src} are not supported. Meters will be applied by default.",
level=1,
func=inspect.stack()[0][3],
)
return 1.0
except:
print(
f"Units {units} are not supported. Meters will be applied by default."
)
return 1.0
except Exception as e:
try:
from speckle.utils.panel_logging import logToUser

logToUser(
f"{e}. Meters will be applied by default.",
level=2,
func=inspect.stack()[0][3],
f"Units {units_src} are not supported. Meters will be applied by default."
)
return 1.0
except:
print(f"{e}. Meters will be applied by default.")
return 1.0


def jsonFromList(jsonObj: dict, levels: list):
Expand Down
13 changes: 13 additions & 0 deletions speckle/converter/features/GisFeature.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from typing import List, Optional

from specklepy.objects.base import Base


class GisFeature(
Base, speckle_type="Objects.GIS.GisFeature", detachable={"displayValue"}
):
"""GIS Feature"""

geometry: Optional[List[Base]] = None
attributes: Base
displayValue: Optional[List[Base]] = None
Loading

0 comments on commit 16affa5

Please sign in to comment.