dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #20166
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 9091: GIS scripts
------------------------------------------------------------
revno: 9091
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2012-11-20 22:04:24 +0100
message:
GIS scripts
modified:
dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/style/dashboard.css
resources/sql/div.sql
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/style/dashboard.css'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/style/dashboard.css 2012-11-15 17:28:14 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/style/dashboard.css 2012-11-20 21:04:24 +0000
@@ -63,7 +63,6 @@
.labelText
{
- position: relative;
color: #999;
font-size: 16px;
padding: 40px 0 0 30px;
=== modified file 'resources/sql/div.sql'
--- resources/sql/div.sql 2012-11-16 14:01:45 +0000
+++ resources/sql/div.sql 2012-11-20 21:04:24 +0000
@@ -103,6 +103,21 @@
(select count(*) from reporttable_periods where reporttableid=rt.reporttableid) as pe
from reporttable rt;
+-- Turn longitude/latitude around for organisationunit coordinates (adjust the like clause)
+
+update organisationunit set coordinates=regexp_replace(coordinates,'\[(.+?\..+?),(.+?\..+?)\]','[\2,\1]')
+where coordinates like '[0%'
+and featuretype='Point';
+
+-- Nullify coordinates with longitude outside range (adjust where clause values)
+
+update organisationunit set coordinates=null
+where featuretype='Point'
+and (
+ cast(substring(coordinates from '\[(.+?\..+?),.+?\..+?\]') as double precision) < 32
+ or cast(substring(coordinates from '\[(.+?\..+?),.+?\..+?\]') as double precision) > 43
+);
+
-- Insert random org unit codes
create function setrandomcode() returns integer AS $$