-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import psycopg2 | ||
|
||
# Initialize database parameters | ||
host = "metis.geodan.nl" | ||
user = "freekb" | ||
dbname = "research" | ||
port = "5432" | ||
|
||
mapping = {"OSM_Roads": "freeks_schema.osmweg"} | ||
|
||
|
||
class DBConnect: | ||
|
||
def __init__(self, host="", user="", dbname="", port=""): | ||
self.conn = psycopg2.connect("host={} user={} dbname={} port={}".format(host, user, dbname, port)) | ||
self.cur = self.conn.cursor() | ||
|
||
def do_query(self, query): | ||
self.cur.execute(query) | ||
return self.cur.fetchall() | ||
|
||
def close(self): | ||
self.cur.close() | ||
self.conn.close() |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[[source]] | ||
name = "pypi" | ||
url = "https://pypi.org/simple" | ||
verify_ssl = true | ||
|
||
[dev-packages] | ||
|
||
[packages] | ||
lxml = "*" | ||
psycopg2 = "*" | ||
|
||
[requires] | ||
python_version = "3.7" |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
for each namedLayer: | ||
layerToQuery = <Name> | ||
if child is namedStyle: | ||
print(Dit is een Namedstyle, weet niet wat ik moet doen) | ||
if child is UserStyle: | ||
for each FeatureTypeStyle: | ||
for each Rule: | ||
if filter exists: | ||
check for and / or | ||
check filter type (equality, >, <) | ||
check min scale, max scale | ||
|
||
|
||
|
||
for each userLayer: | ||
negeer voor nu | ||
|
||
|
||
TODO: | ||
|
||
ogc:function? | ||
spatial operators? | ||
userlayers | ||
geen filter in een rule? |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import DBaccess | ||
|
||
db = DBaccess.DBConnect(DBaccess.host, DBaccess.user, DBaccess.dbname, DBaccess.port) | ||
|
||
query = """ | ||
CREATE TABLE freeks_schema.pytest AS( | ||
SELECT * | ||
FROM freeks_schema.osmweg | ||
LIMIT 10) | ||
""" | ||
|
||
db.cur.execute(query) | ||
db.conn.commit() | ||
db.close() | ||
|