Skip to content

Commit

Permalink
bug in gis loader for points, change point size GIS to be smaller
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinW-S2M committed Nov 15, 2024
1 parent 558f432 commit fef5c95
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "WISDAM"
version = "1.0.6"
version = "1.0.7"
authors = [
{ name="Martin Wieser"},
]
Expand Down
6 changes: 4 additions & 2 deletions src/WISDAM/core_interface/loader_digitizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ def draw_geometry_projections(scene: ImageScene,
object_type = object_data['object_type']
if geom['type'] == 'Point':

p_pixel = image.image_model.project(np.array(geom['coordinates']))[0, :]
result_projection = image.image_model.project(np.array(geom['coordinates']))

p_pixel, pixel_mask = result_projection
if p_pixel is None:
return

Expand All @@ -113,7 +115,7 @@ def draw_geometry_projections(scene: ImageScene,
reviewed=object_data['reviewed'],
source=object_data['source'])

new_item.setRect(p_pixel[0] - point_size / 2.0, p_pixel[1] - point_size / 2.0,
new_item.setRect(p_pixel[0][0] - point_size / 2.0, p_pixel[0][1] - point_size / 2.0,
point_size, point_size)

elif geom['type'] == 'LineString':
Expand Down
12 changes: 6 additions & 6 deletions src/WISDAM/core_interface/loader_gis.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ def draw_footprints(footprint, color, persistent_index):

item_point.setToolTip("ID: %i ; %s" % (footprint['id'], footprint['name']))

item_point.setRect(footprint['x'] - point_size_gis_standard / 8.0,
-footprint['y'] - point_size_gis_standard / 8.0,
point_size_gis_standard / 4.0, point_size_gis_standard / 4.0)
item_point.setRect(footprint['x'] - point_size_gis_standard / 10.0,
-footprint['y'] - point_size_gis_standard / 10.0,
point_size_gis_standard / 5.0, point_size_gis_standard / 5.0)

item_footprint.setParentItem(item_point)
item_footprint.setVisible(False)
Expand All @@ -103,8 +103,8 @@ def draw_geom(geom_data, point_size: float, color_value):
reviewed=geom_data['reviewed'],
source=geom_data['source'],
pen_width=0)
new_item.setRect(geom['coordinates'][0] - point_size / 2.0, -geom['coordinates'][1] - point_size / 2.0,
point_size, point_size)
new_item.setRect(geom['coordinates'][0] - point_size / 14.0, -geom['coordinates'][1] - point_size / 14.0,
point_size/7, point_size/7)

elif geom['type'] == 'LineString':

Expand All @@ -118,7 +118,7 @@ def draw_geom(geom_data, point_size: float, color_value):
reviewed=geom_data['reviewed'],
source=geom_data['source'],
pen_width=0,
stroke_buffer=point_size_gis_standard / 2)
stroke_buffer=point_size_gis_standard / 6)

path = QPainterPath(QPointF(geom['coordinates'][0][0], -geom['coordinates'][0][1]))
for coo in geom['coordinates'][1:]:
Expand Down

0 comments on commit fef5c95

Please sign in to comment.