Skip to content

Commit

Permalink
ADD: drawPLC shows region markers at their position (#487) if regionM…
Browse files Browse the repository at this point in the history
…arker=True
  • Loading branch information
halbmy committed Feb 9, 2023
1 parent 051dd3b commit fce93b5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions pygimli/viewer/mpl/meshview.py
Expand Up @@ -734,6 +734,10 @@ def drawPLC(ax, mesh, fillRegion=True, regionMarker=True,
areas = {}
for reg in mesh.regionMarkers():
areas[reg.marker()] = reg.area()
ax.plot(reg.x(), reg.y(), "mx", alpha=0.5)
ax.text(reg.x(), reg.y(), str(reg.marker()), color="m",
ha="center", va="center")

labels = []
for marker in uniquemarkers:
label = "{:d}".format(marker)
Expand Down
4 changes: 3 additions & 1 deletion pygimli/viewer/mpl/overlayimage.py
Expand Up @@ -437,11 +437,13 @@ def underlayBKGMap(ax, mode='DOP', utmzone=32, epsg=0, imsize=2500, uuid='',
fmt=fmt[mode.upper()], layer=lay[mode.upper()])
imname = mode + box + ext[mode]
if not os.path.isfile(imname): # not already existing
print('Retrieving file from geodatenzentrum.de using URL: ' + ad)
pg.info('Retrieving file from geodatenzentrum.de using URL: ' + ad)
req = urllib2.Request(ad)
response = urllib2.urlopen(req)
with open(imname, 'wb') as output:
output.write(response.read())
else:
pg.info('Found image file: ' + imname)

im = mpimg.imread(imname)
bb = [int(bi) for bi in box.split(',')] # bounding box
Expand Down

0 comments on commit fce93b5

Please sign in to comment.