Skip to content

Commit

Permalink
fixed point layer display
Browse files Browse the repository at this point in the history
  • Loading branch information
voisardf committed Jan 23, 2020
1 parent 937354a commit ac27ad6
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion crdppf/lib/content.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,10 @@ def add_layer(layer, featureid, featureinfo, translations, appconfig, topicdata)
groupedresult = {}
for code in codegenres:
for result in results:
measure = int(result['properties']['intersectionMeasure'].replace(' : ', '').replace(' - ', '').replace('[m2]', '').replace('[m]', ''))
if result['properties']['intersectionMeasure'] == ' ':
measure = None
else:
measure = int(result['properties']['intersectionMeasure'].replace(' : ', '').replace(' - ', '').replace('[m2]', '').replace('[m]', ''))
if result['properties']['codegenre'] == code:
if code in groupedresult:
groupedresult[code]["intersectionMeasure"] += measure
Expand Down Expand Up @@ -476,6 +479,13 @@ def get_content(id, request):
"area_pct": round((float(
feature['intersectionMeasure'])*100)/propertyarea, 1)
})
elif feature['geomType'] == 'point':
topicdata[str(topic.topicid)]["restrictions"].append({
"codegenre": legenddir+feature['codegenre']+".png",
"teneur": feature['teneur'],
"area": '',
"area_pct": -1
})
else:
topicdata[str(topic.topicid)]["restrictions"].append({
"codegenre": legenddir+feature['codegenre']+".png",
Expand Down

0 comments on commit ac27ad6

Please sign in to comment.