Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
raven
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Rune Åvar Ødegård
raven
Commits
1f7d0bdd
Commit
1f7d0bdd
authored
2 years ago
by
Rune Åvar Ødegård
Browse files
Options
Downloads
Patches
Plain Diff
Add unique gml:id on polygons
parent
e4a1dd31
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
web/api/dataflows/b/b_get_handler.py
+1
-1
1 addition, 1 deletion
web/api/dataflows/b/b_get_handler.py
web/helpers/eea/geometry.py
+7
-4
7 additions, 4 deletions
web/helpers/eea/geometry.py
with
8 additions
and
5 deletions
web/api/dataflows/b/b_get_handler.py
+
1
−
1
View file @
1f7d0bdd
...
...
@@ -103,7 +103,7 @@ class BGetHandler:
z.
"
year
"
,
z.area,
ra.
"
name
"
ra_name,
ST_AsGML(3,z.geom,15,1
6
,
'
gml
'
, z.
"
name
"
) gml,
ST_AsGML(3,z.geom,15,1
7
,
'
gml
'
, z.
"
name
"
) gml,
ra.organisation ra_organisation,
ra.
"
locator
"
ra_locator,
ra.postcode ra_postcode,
...
...
This diff is collapsed.
Click to expand it.
web/helpers/eea/geometry.py
+
7
−
4
View file @
1f7d0bdd
...
...
@@ -17,12 +17,15 @@ class Geometry:
self
.
namespace
=
ns
def
as_element
(
self
):
# Need to have unique gml:id on sub polygon level
toBeReplaced
=
"
gml:Polygon gml:id=
"
+
'"'
+
self
.
name
+
'"
>
'
numberOfOccurences
=
self
.
gml
.
count
(
toBeReplaced
)
self
.
gml
=
self
.
gml
.
replace
(
"
EPSG:
"
,
"
urn:ogc:def:crs:EPSG::
"
)
root
=
Element
(
"
{
"
+
self
.
namespace
+
"
}geometry
"
)
for
n
in
range
(
1
,
numberOfOccurences
):
replacer
=
"
gml:Polygon gml:id=
"
+
'"'
+
self
.
name
+
"
_
"
+
str
(
n
)
+
'"
>
'
self
.
gml
=
self
.
gml
.
replace
(
toBeReplaced
,
replacer
,
1
)
root
=
Element
(
"
{
"
+
self
.
namespace
+
"
}geometry
"
)
gml
=
io
.
StringIO
(
'''
<root xmlns:gml=
"
http://www.opengis.net/gml/3.2
"
>
'''
+
self
.
gml
+
'
</root>
'
)
gml_info
=
ET
.
parse
(
gml
).
getroot
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment