Remove GDAL/ogr requirement as MySQL now can do spatial queries correctly.
authorphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Thu, 9 May 2019 19:04:26 +0000 (19:04 +0000)
committerphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Thu, 9 May 2019 19:04:26 +0000 (19:04 +0000)
git-svn-id: http://www.winterrodeln.org/svn/wrfeed/trunk@2799 7aebc617-e5e2-0310-91dc-80fb5f6d2477

setup.py
wrfeed/berichte.py

index 9472eb554925818b9ee500074c0b93f10ef9a1c5..35cfb75d46d496458e5f15d181e1fd3a16a3fec7 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -10,7 +10,6 @@ setup(
     install_requires=[
         "flask>=0.12",
         "SQLAlchemy>=0.5",
-        "GDAL",
     ],
     packages=['wrfeed'],
     include_package_data=True,
index 10e83af7f7ac1f1649e11463388d86ebad2c3782..34cbb9d89e8fe8737741beb11db9efc41d459f19 100644 (file)
@@ -12,7 +12,6 @@ See:
 """
 import datetime
 from xml.etree.ElementTree import Element, SubElement, tostring
-from osgeo import ogr
 from flask import url_for
 
 
@@ -61,9 +60,6 @@ def create_feed(conn, limit, page_title=None, page_ids=None, region_name=None):
         border_wkb = row['border_wkb'] # border as WKB
         where += ' and contains(geomfromwkb(%s), point(position_longitude, position_latitude))'
         params += [border_wkb]
-        # the following variables are needed for the additional filtering below
-        border = ogr.CreateGeometryFromWkb(border_wkb)
-        point = ogr.Geometry(ogr.wkbPoint)
     else:
         # user wants to have all reports
         pass
@@ -89,14 +85,6 @@ def create_feed(conn, limit, page_title=None, page_ids=None, region_name=None):
     for row in result:
         page_id, page_title, report_id, date_report, date_entry, condition, description, author_name, author_userid, author_username, lon, lat = row
 
-        if not region_name is None:
-            # mysql 5.5 doesn't have specification conform geospacial functions.
-            # http://dev.mysql.com/doc/refman/5.5/en/functions-for-testing-spatial-relations-between-geometric-objects.html
-            # therefore we have to do further filtering here.
-            point.SetPoint(0, lon, lat)
-            if not point.Within(border):
-                continue
-
         page_title_url = page_title.replace(' ', '_')
         entry = SubElement(feed, "entry")
         entry_title = SubElement(entry, "title")