-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extract utils for line and polygon element
- Loading branch information
1 parent
85e64c5
commit 2befefa
Showing
3 changed files
with
35 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# frozen_string_literal: true | ||
|
||
require_relative '../base' | ||
require_relative '../other/transform' | ||
require_relative '../other/block_definition' | ||
require_relative '../other/block_instance' | ||
require_relative '../../constants/type_constants' | ||
require_relative '../../sketchup_model/dictionary/dictionary_handler' | ||
|
||
module SpeckleConnector | ||
module SpeckleObjects | ||
module GIS | ||
def self.get_definition_name(obj, attributes) | ||
return obj['name'] unless obj['name'].nil? | ||
|
||
return attributes['name'] unless attributes['name'].nil? | ||
|
||
return "def::#{obj['id']}" | ||
end | ||
|
||
def self.get_qgis_attributes(obj) | ||
attributes = obj['attributes'].to_h | ||
speckle_properties = %w[id speckle_type totalChildrenCount units applicationId] | ||
speckle_properties.each { |key| attributes.delete(key) } | ||
attributes | ||
end | ||
end | ||
end | ||
end |