svn commit: r798 - trunk/mapbender/http/javascripts/transform_coordinatesWGS84.php

vera_schulze at osgeo.org vera_schulze at osgeo.org
Wed Oct 18 07:19:48 EDT 2006


Author: vera_schulze
Date: 2006-10-18 11:19:48+0000
New Revision: 798

Added:
   trunk/mapbender/http/javascripts/transform_coordinatesWGS84.php

Log:
script to measure with EPSG 4326 (in combination with mod_measure3426.php)

Added: trunk/mapbender/http/javascripts/transform_coordinatesWGS84.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/transform_coordinatesWGS84.php?view=auto&rev=798
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/transform_coordinatesWGS84.php	2006-10-18 11:19:48+0000
@@ -0,0 +1,49 @@
+<?php
+# $Id: mod_measure.php 267 2006-05-12 12:16:01Z vera_schulze $
+# http://www.mapbender.org/index.php/mod_measure.php
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+require_once("../../conf/mapbender.conf");
+
+$DBSERVER = '192.168.0.100';
+$OWNER = "admin";
+$PW = "&see5Toxu?";  
+
+$con = pg_connect('host=' . $DBSERVER . ' user=' . $OWNER . ' password=' . $PW . ' dbname=merlin');
+
+
+
+$sql_pointA = "SELECT X(transform(GeometryFromText('POINT(".$_POST['x1']." ".$_POST['y1'].")',4326),".$_POST['inputEPSG'].")) as minx, Y(transform(GeometryFromText('POINT(".$_POST['x1']." ".$_POST['y1'].")',4326),".$_POST['inputEPSG'].")) as miny;";
+
+$resA = db_query($sql_pointA);
+$recA = pg_fetch_array($resA);
+
+$sql_pointB = "SELECT X(transform(GeometryFromText('POINT(".$_POST['x2']." ".$_POST['y2'].")',4326),".$_POST['inputEPSG'].")) as maxx, Y(transform(GeometryFromText('POINT(".$_POST['x2']." ".$_POST['y2'].")',4326),".$_POST['inputEPSG'].")) as maxy;";
+
+$resB = db_query($sql_pointB);
+$recB = pg_fetch_array($resB);
+
+$sql_dist = "SELECT distance('POINT(".$recA['minx']." ".$recA['miny']. ")','POINT(" . $recB['maxx']." ". $recB['maxy'].")') as dist;";
+$res_dist = db_query($sql_dist);
+$rec_dist = pg_fetch_array($res_dist);
+
+echo $rec_dist['dist'];
+#echo $recA['minx']. "," . $recA['miny'] . "," . $recB['maxx']. "," . $recB['maxy']. "," .$rec_dist['dist'];
+
+
+
+?>




More information about the Mapbender_commits mailing list