Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Adressen Integration
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maximilian Loch
Adressen Integration
Commits
161e0c53
Commit
161e0c53
authored
2 years ago
by
Maximilian Loch
Browse files
Options
Downloads
Patches
Plain Diff
fixed print messages
parent
db74bb58
Branches
Branches containing commit
Tags
1.8.0-info
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
example_conn.cfg
+2
-1
2 additions, 1 deletion
example_conn.cfg
geocoder_script.py
+12
-10
12 additions, 10 deletions
geocoder_script.py
with
14 additions
and
11 deletions
example_conn.cfg
+
2
−
1
View file @
161e0c53
...
...
@@ -4,3 +4,4 @@ port=port
dbname
=
database name
user
=
username
pwd
=
password
url
=
API url
\ No newline at end of file
This diff is collapsed.
Click to expand it.
geocoder_script.py
+
12
−
10
View file @
161e0c53
...
...
@@ -16,7 +16,7 @@ if __name__ == '__main__':
user=
{
conn_config
[
'
connection
'
][
'
user
'
]
}
password=
{
conn_config
[
'
connection
'
][
'
pwd
'
]
}
"""
url
=
r
"
https://chat.gdi-sh.de/aregapi/
"
url
=
conn_config
[
'
connection
'
][
'
url
'
]
# logfile = r"geocoder.log"
my_db
=
DBTools
(
conn_str
)
...
...
@@ -50,12 +50,12 @@ if __name__ == '__main__':
if
areg_response_key
[
0
]
==
"
ERROR
"
:
errorfeatures
+=
1
pr
int
(
areg_response_key
[
0
]
+
"
:
"
+
areg_response
[
areg_response_key
[
0
]]
+
f
"""
| betroffene schule: [
{
item
[
0
]
}
]
\t
{
adresse
[
'
hnr
'
]
}
;
{
adresse
[
'
stn
'
]
}
;
{
adresse
[
'
plz
'
]
}
;
{
adresse
[
'
ort
'
]
}
"""
)
pr
ogress_msg
=
f
"""
\
{
areg_response_key
[
0
]
}
:
{
areg_response
[
areg_response_key
[
0
]
]
}
| betroffene \
schule: [
{
item
[
0
]
}
]
\t
{
adresse
[
'
hnr
'
]
}
;
{
adresse
[
'
stn
'
]
}
;
{
adresse
[
'
plz
'
]
}
; \
{
adresse
[
'
ort
'
]
}
"""
print
(
progress_msg
)
my_db
.
closecursor
()
...
...
@@ -65,7 +65,9 @@ if __name__ == '__main__':
# out.write(item)
percentage
=
round
((
numfeatures
*
100
)
/
maxfeatures
,
2
)
print
(
f
"""
\n
statistics:
\n
{
numfeatures
}
from
{
maxfeatures
}
geocoded >>
{
percentage
}
%
\n
{
missinfeatures
}
features with missing attributes
\n
{
errorfeatures
}
features with errors
\n
"""
)
statistics
=
f
"""
statistics:
\n
{
numfeatures
}
from
{
maxfeatures
}
geocoded >> \
{
percentage
}
%
\n
{
missinfeatures
}
features with missing attributes
\n
\
{
errorfeatures
}
features with errors
\n
"""
print
(
statistics
)
print
(
"
geocoding dataset finished, closing programm
"
)
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