diff -Nru zorba-geoproj-module-2.9.1/debian/bzr-builder.manifest zorba-geoproj-module-3.0.0/debian/bzr-builder.manifest --- zorba-geoproj-module-2.9.1/debian/bzr-builder.manifest 2013-05-30 16:37:16.000000000 +0000 +++ zorba-geoproj-module-3.0.0/debian/bzr-builder.manifest 2013-11-07 17:16:53.000000000 +0000 @@ -1,3 +1,3 @@ -# bzr-builder format 0.3 deb-version {debupstream}-0 -lp:zorba/geoproj-module revid:juan457@gmail.com-20120807194924-w8pmqsrf510fq3yv -nest-part debian_rules lp:~zorba-coders/zorba/debian_control_files debian_files/zorba-geoproj-module_debian_rules/debian debian revid:juan457@gmail.com-20130529150701-m2co1uzthg4pkjy5 +# bzr-builder format 0.3 deb-version 3.0.0-0 +lp:zorba/geoproj-module revid:jenkins@lambda.nu-20130930220203-n7b681sn1zhi7l2i +nest-part debian_rules lp:~zorba-coders/zorba/debian_control_files debian_files/zorba-geoproj-module_debian_rules/debian debian revid:juan457@gmail.com-20131031190552-9p76o0q432489tw2 diff -Nru zorba-geoproj-module-2.9.1/debian/changelog zorba-geoproj-module-3.0.0/debian/changelog --- zorba-geoproj-module-2.9.1/debian/changelog 2013-05-30 16:37:16.000000000 +0000 +++ zorba-geoproj-module-3.0.0/debian/changelog 2013-11-07 17:16:53.000000000 +0000 @@ -1,12 +1,6 @@ -zorba-geoproj-module (2.9.1-0~precise1) precise; urgency=low +zorba-geoproj-module (3.0.0-0~ubuntu12.04.1) precise; urgency=low * Auto build. - -- Juan Zacarias Thu, 30 May 2013 16:37:16 +0000 - -zorba-geoproj-module (2.9.1) unstable; urgency=low - - *Updated to current Version - - -- Juan Zacarias Wed, 29 May 2013 08:06:37 -0700 + -- Juan Zacarias Thu, 07 Nov 2013 17:16:53 +0000 diff -Nru zorba-geoproj-module-2.9.1/debian/copyright zorba-geoproj-module-3.0.0/debian/copyright --- zorba-geoproj-module-2.9.1/debian/copyright 2013-05-30 16:37:16.000000000 +0000 +++ zorba-geoproj-module-3.0.0/debian/copyright 2013-11-07 17:16:52.000000000 +0000 @@ -1,5 +1,4 @@ This package was debianized by Juan Zacarias on -Wed, 29 May 2013 08:06:37 -0700 It was downloaded from http://www.zorba-xquery.com diff -Nru zorba-geoproj-module-2.9.1/src/CMakeLists.txt zorba-geoproj-module-3.0.0/src/CMakeLists.txt --- zorba-geoproj-module-2.9.1/src/CMakeLists.txt 2013-05-30 16:37:14.000000000 +0000 +++ zorba-geoproj-module-3.0.0/src/CMakeLists.txt 2013-11-07 17:16:50.000000000 +0000 @@ -11,10 +11,6 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - -# all external module libraries are generated in the directory -# of the corresponding .xq file -MESSAGE(STATUS "Add com") -ADD_SUBDIRECTORY(com) - -MESSAGE(STATUS "End modules") +DECLARE_ZORBA_SCHEMA (FILE geoproj-param.xsd + URI "http://zorba.io/modules/geoproj-param") +DECLARE_ZORBA_MODULE (URI "http://zorba.io/modules/geoproj" VERSION 1.0 FILE "geoproj.xq") diff -Nru zorba-geoproj-module-2.9.1/src/com/CMakeLists.txt zorba-geoproj-module-3.0.0/src/com/CMakeLists.txt --- zorba-geoproj-module-2.9.1/src/com/CMakeLists.txt 2013-05-30 16:37:14.000000000 +0000 +++ zorba-geoproj-module-3.0.0/src/com/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -# Copyright 2006-2008 The FLWOR Foundation. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -ADD_SUBDIRECTORY(zorba-xquery) diff -Nru zorba-geoproj-module-2.9.1/src/com/zorba-xquery/CMakeLists.txt zorba-geoproj-module-3.0.0/src/com/zorba-xquery/CMakeLists.txt --- zorba-geoproj-module-2.9.1/src/com/zorba-xquery/CMakeLists.txt 2013-05-30 16:37:14.000000000 +0000 +++ zorba-geoproj-module-3.0.0/src/com/zorba-xquery/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -# Copyright 2006-2008 The FLWOR Foundation. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -ADD_SUBDIRECTORY(www) diff -Nru zorba-geoproj-module-2.9.1/src/com/zorba-xquery/www/CMakeLists.txt zorba-geoproj-module-3.0.0/src/com/zorba-xquery/www/CMakeLists.txt --- zorba-geoproj-module-2.9.1/src/com/zorba-xquery/www/CMakeLists.txt 2013-05-30 16:37:14.000000000 +0000 +++ zorba-geoproj-module-3.0.0/src/com/zorba-xquery/www/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -# Copyright 2006-2008 The FLWOR Foundation. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -ADD_SUBDIRECTORY(modules) diff -Nru zorba-geoproj-module-2.9.1/src/com/zorba-xquery/www/modules/CMakeLists.txt zorba-geoproj-module-3.0.0/src/com/zorba-xquery/www/modules/CMakeLists.txt --- zorba-geoproj-module-2.9.1/src/com/zorba-xquery/www/modules/CMakeLists.txt 2013-05-30 16:37:14.000000000 +0000 +++ zorba-geoproj-module-3.0.0/src/com/zorba-xquery/www/modules/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -# Copyright 2006-2008 The FLWOR Foundation. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -DECLARE_ZORBA_SCHEMA (FILE geoproj-param.xsd - URI "http://www.zorba-xquery.com/modules/geoproj-param") -DECLARE_ZORBA_MODULE (URI "http://www.zorba-xquery.com/modules/geoproj" VERSION 1.0 FILE "geoproj.xq") diff -Nru zorba-geoproj-module-2.9.1/src/com/zorba-xquery/www/modules/geoproj-param.xsd zorba-geoproj-module-3.0.0/src/com/zorba-xquery/www/modules/geoproj-param.xsd --- zorba-geoproj-module-2.9.1/src/com/zorba-xquery/www/modules/geoproj-param.xsd 2013-05-30 16:37:14.000000000 +0000 +++ zorba-geoproj-module-3.0.0/src/com/zorba-xquery/www/modules/geoproj-param.xsd 1970-01-01 00:00:00.000000000 +0000 @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -Nru zorba-geoproj-module-2.9.1/src/com/zorba-xquery/www/modules/geoproj.xq zorba-geoproj-module-3.0.0/src/com/zorba-xquery/www/modules/geoproj.xq --- zorba-geoproj-module-2.9.1/src/com/zorba-xquery/www/modules/geoproj.xq 2013-05-30 16:37:14.000000000 +0000 +++ zorba-geoproj-module-3.0.0/src/com/zorba-xquery/www/modules/geoproj.xq 1970-01-01 00:00:00.000000000 +0000 @@ -1,516 +0,0 @@ -xquery version "3.0"; - -(: - : Copyright 2006-2009 The FLWOR Foundation. - : - : Licensed under the Apache License, Version 2.0 (the "License"); - : you may not use this file except in compliance with the License. - : You may obtain a copy of the License at - : - : http://www.apache.org/licenses/LICENSE-2.0 - : - : Unless required by applicable law or agreed to in writing, software - : distributed under the License is distributed on an "AS IS" BASIS, - : WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - : See the License for the specific language governing permissions and - : limitations under the License. -:) - -(:~ - : Geographic projection module.
- : Forward and inverse projection from WGS84 lat-long coordinates to Oblique Mercator x-y projection.
- : Oblique Mercator projection is a sphere to cylinder projection.
- : This projection results in a conformal output, meaning the shape of small areas is preserved, - : no matter the distance from the origin. But it is not equal area, meaning the area size increases heavily - : when getting closer to North or South. The area size increases with the same amount on x and y axes, - : so the relative shape remains almost the same.
- : Mercator projection is the oldest projection, and it is still widely used because it produces a rectangular map. - : This projection is used in Google Maps because of its conformal output.
- : For military or measurements purposes the UTM projection is used (or variants). This splits the Earth into small - : areas and computes the cartesian coordinates relative to each area.
- :
- : Here we use Oblique Mercator projection. Its advantage over the normal Mercator is that you can set the tangent point - : between the cylinder and the sphere to be anywhere on Earth. So you can set the center of the map to be close - : to the area you want projected and be able to measure accurately the distances between points and lines. - : The map deformation is minimal close to the center point and close to the "equator" line.
- : The advantage over the UTM projection is that it can also produce a global rectangular map, like Mercator, - : which is great for viewing.
- : The disadvantage over Mercator is that it needs more processing power.
- :
- : WGS84 is the ellipsoid aproximation of the Earth, with big radius of 6,378,137 m and small radius of 6,356,752.3 m. - : The geographic coordinates expressed for this ellipsoid are widely used today in maps and gps coordinates. - : It is the default standard for representing geographic coordinates.
- :
- : The purpose of this module is to provide convertion from polar to cartesian coordinates, so you can - : process the geographic data with the Simple Features API functions implemented in the geo module. - : That module works only with cartesian coordinates, but most maps have polar coordinates.
- :
- : The projection formulas are taken from lib_proj library and implemented in XQuery. - : - : @author Daniel Turcanu - : @project geo - :) -module namespace geoproj = "http://www.zorba-xquery.com/modules/geoproj"; - -(:~ - : W3C Math namespace URI. -:) -declare namespace math="http://www.w3.org/2005/xpath-functions/math"; - -declare namespace err = "http://www.w3.org/2005/xqt-errors"; - -(:~ - : Import module for checking if geoproj parameters are validated. - :) -import module namespace schemaOptions = "http://www.zorba-xquery.com/modules/schema"; - - -(:~ - : Contains the definitions of the geoproj parameters. -:) -import schema namespace geoproj-param = "http://www.zorba-xquery.com/modules/geoproj-param"; - -declare namespace gml="http://www.opengis.net/gml"; - -declare namespace ver = "http://www.zorba-xquery.com/options/versioning"; -declare option ver:module-version "1.0"; - -(:~ - : Convert angle from degrees to radians.
- : The parameter is first reduced to value range of (-360, 360). - : - : @param $deg angle in degrees - : @return value in radians (-2PI, 2PI) - :) -declare function geoproj:deg-to-rad($deg as xs:double) as xs:double -{ - ($deg mod 360) * 2 * math:pi() div 360 -}; - -(:~ - : Convert angle from radians to degrees.
- : - : @param $rad value in radians - : @return value in degrees (-360, 360) - :) -declare function geoproj:rad-to-deg($rad as xs:double) as xs:double -{ - ($rad * 360 div 2 div math:pi()) mod 360 -}; - - -(:~ - : Compute the isometric latitude of $phi latitude. - : - : @param $phi a latitude - : @return isometric latitude in radians - :) -declare %private function geoproj:proj-tsfn($phi as xs:double) as xs:double -{ - let $e as xs:double := 0.0818192E0 - return - math:tan(math:pi() div 4 - $phi div 2) div math:pow((1 - $e * math:sin($phi)) div (1 + $e * math:sin($phi)), $e div 2) -}; - -declare %private function geoproj:wgs84-to-omerc-validated( - $lat_0 as xs:double, - $long_c as xs:double, - $k0 as xs:double, - $lat_long_degrees as element(geoproj-param:latlong, geoproj-param:latlongType)*) as element(geoproj-param:coord)* -{ - let $e as xs:double := 0.0818192E0 - let $e2 := $e*$e - let $phi0 := geoproj:deg-to-rad($lat_0) - let $lambda0 := geoproj:deg-to-rad($long_c) - let $sin_phi0 := math:sin($phi0) - let $sin2_phi0 := $sin_phi0 * $sin_phi0 - let $cos_phi0 := math:cos($phi0) - let $aphi0 := abs($phi0) - let $B := if ($aphi0 gt 1e-10) then math:sqrt(1 + $e2 div (1 - $e2) * math:pow($cos_phi0, 4)) else math:sqrt(1 - $e2) - let $A := if ($aphi0 gt 1e-10) then $B * $k0 * math:sqrt(1 - $e2) div (1 - $e2*$sin2_phi0) else $k0 - let $t0 := geoproj:proj-tsfn($phi0) - let $D := if ($aphi0 gt 1e-10) then $B * math:sqrt(1 - $e2) div ($cos_phi0 * math:sqrt(1 - $e2*$sin2_phi0)) else 1 - let $D := if ($D*$D < 1) then 1 else $D - let $F := if ($aphi0 gt 1e-10) then if ($phi0 < 0) then $D - math:sqrt($D*$D - 1) else $D + math:sqrt($D*$D - 1) else 1 - let $E := if ($aphi0 gt 1e-10) then math:pow($t0, $B) * $F else 1 - - let $G := ($F - 1 div $F) div 2 - let $uc := abs($A div $B * math:atan2(math:sqrt($D*$D - 1), 1)) - let $uc := if ($phi0 < 0) then -$uc else $uc - - for $latlong in $lat_long_degrees - let $phi := geoproj:deg-to-rad($latlong/*:lat) - let $lambda := geoproj:deg-to-rad($latlong/*:long) - let $V := math:sin($B * ($lambda - $lambda0)) - return - if (abs($phi) lt (math:pi() div 2 - 1.e-10)) then - let $Q := $E div math:pow(geoproj:proj-tsfn($phi) , $B) - let $S := ($Q - 1 div $Q) div 2 - let $T := ($Q + 1 div $Q) div 2 - let $U := -$V div $T - let $v := if (abs($U) ne 1) then $A div (2 * $B) * math:log((1 - $U) div (1 + $U)) else 1 div 0 - let $M := math:cos($B * ($lambda - $lambda0)) - let $u := if ($M gt 1e-7) then $A div $B * math:atan2($S, $M) else $A*$B*($lambda - $lambda0) - let $u := $u - $uc - let $x := $v - let $x := $x * 6378137 - let $y := $u - let $y := $y * 6378137 - return {$x} {$y} - else - let $v := $A div $B * -4.2897288031186085136750723197195 - let $u := $phi * $A div $B - let $u := $u - $uc - let $x := $v - let $x := $x * 6378137 - let $y := $u - let $y := $y * 6378137 - return {$x} {$y} -}; - -(:~ - : Forward projection from geographic coordinates lat-long on WGS84 ellipsoid to Oblique Mercator cylinder.
- : The Oblique Mercator projection is like the standard Mercator projection, but you can choose the point of origin.
- : Specify the coordinates of the center point somewhere near the points being projected, - : so the projection deformation is small.
- : The azimuth in the center point, alpha, is hardcoded to zero, so the true north is preserved. - : This is a simplification of the standard Oblique Mercator projection.
- : Gamma, the azimuth of the rectified bearing of center line is also zero, calculated from alpha.
- :
- : The radius of the Earth in WGS84 is 6378137 m.
- : Reverse flatening 298.257223563.
- : Eccentricity e 0.0818192.
- :
- : @param $lat_0 is the latitude for center point, in degrees (-90, 90) - : @param $long_c is the longitude for center point, in degrees (-180, 180) - : @param $k0 is the scale in the center point. The scale will increase when going far to north and south. - : Use value 1 to get the true distances between points, in meters. - : At equator, the distance for 1 degree is aproximately 110 km. - : @param $lat_long_degrees a sequence of nodes of type
- : <latlong><lat>latitude degree</lat><long>longitude degree</long></latlong>
- : in namespace "http://www.zorba-xquery.com/modules/geoproj-param". Each node in the sequence is validated - : against the according schema. - : - : @error err:XQDY0027 if any of the nodes passed in the $lat-long-degress parameter is - : not valid according to the schema. - : - : @return a sequence of x-y coordinates in format
- : <coord><x>x</x><y>y</y></coord>
- : in namespace "http://www.zorba-xquery.com/modules/geoproj-param"
- : Note that the x coordinate corresponds to the longitude, and y coordinate to the latitude.
- : The coordinates are expressed in meters.
- : The coordinates are relative to the center point. - @example test/Queries/geo/geoproj1.xq - @example test/Queries/geo/geoproj5.xq - @example test/Queries/geo/geoproj6.xq - @example test/Queries/geo/geoproj8.xq - @example test/Queries/geo/geoproj9.xq - @example test/Queries/geo/geoproj10.xq - @example test/Queries/geo/geoproj12.xq - :) -declare function geoproj:wgs84-to-omerc( $lat-0 as xs:double, - $long-c as xs:double, - $k0 as xs:double, - $lat-long-degrees as element(geoproj-param:latlong)*) as element(geoproj-param:coord)* -{ - let $validated-lat-long := - (for $lat-long-degree in $lat-long-degrees - return - if(empty($lat-long-degree)) then - $lat-long-degrees - else - validate{$lat-long-degree} ) - return - geoproj:wgs84-to-omerc-validated($lat-0, $long-c, $k0, $validated-lat-long) -}; - - -(:~ - : Forward projection from geographic coordinates lat-long on WGS84 ellipsoid to Oblique Mercator cylinder.
- : This is an intermediate function for wgs84-to-omerc.
- : The difference is that it returns the x-y coordinates in gml:pos format, - : gml being the prefix for the GML namespace "http://www.opengis.net/gml".
- :
- : @param $lat_0 is the latitude for center point, in degrees (-90, 90) - : @param $long_c is the longitude for center point, in degrees (-180, 180) - : @param $k0 is the scale in the center point. - : @param $lat_long_degrees a sequence of nodes of type
- : <latlong><lat>latitude degree</lat><long>longitude degree</long></latlong>
- : in namespace "http://www.zorba-xquery.com/modules/geoproj-param". Each node in this sequence is validated according - : to the according schema. - : - : @error err:XQDY0027 if any of the nodes passed in the $lat-long-degress parameter is - : not valid according to the schema. - : - : @return a sequence of x-y coordinates in format
- : <gml:pos>x y</gml:pos>
- : in namespace "http://www.opengis.net/gml" - @example test/Queries/geo/geoproj3.xq - :) -declare function geoproj:wgs84-to-omerc-gmlpos( $lat-0 as xs:double, - $long-c as xs:double, - $k0 as xs:double, - $lat-long-degrees as element(geoproj-param:latlong)*) as element(gml:pos)* -{ - let $validated-lat-long := - (for $lat-long-degree in $lat-long-degrees - return - if(empty($lat-long-degree)) then - $lat-long-degrees - else - validate{$lat-long-degree} ) - return - geoproj:wgs84-to-omerc-gmlpos-validated($lat-0, $long-c, $k0, $validated-lat-long) -}; - -declare %private function geoproj:wgs84-to-omerc-gmlpos-validated( $lat_0 as xs:double, - $long_c as xs:double, - $k0 as xs:double, - $lat_long_degrees as element(geoproj-param:latlong, geoproj-param:latlongType)*) as element(gml:pos)* -{ - for $coord in geoproj:wgs84-to-omerc($lat_0, $long_c, $k0, $lat_long_degrees) - return - {string($coord/*:x)}{" "}{string($coord/*:y)} -}; - -(:~ - : Function for iterative computing of the inverse isometric latitude. - : - : @param $i the maximum iterations - : @param $ts precomputed value - : @param $e the Earth eccentricity. For WGS84 is hardcoded to 0.0818192. - : @param $prev_phi previous computed inverse isometric latitude - : @return isometric latitude in radians - :) -declare %private function geoproj:proj-phi2-helper($i as xs:integer, - $ts as xs:double , $e as xs:double, - $prev_phi as xs:double) as xs:double -{ - if($i eq 0) then - $prev_phi - else - let $phi := math:pi() div 2 - 2 * math:atan($ts * math:pow((1 - $e * math:sin($prev_phi[1])) div (1 + $e * math:sin($prev_phi[1])), $e div 2)) - return - if (abs($prev_phi - $phi) le 1.0e-10) then - $phi - else - geoproj:proj-phi2-helper($i - 1, $ts, $e, $phi) -}; - -(:~ - : Function for computing the inverse isometric latitude. - : - : @param $ts precomputed value, based on an initial latitude. - : @param $e the Earth eccentricity. For WGS84 is hardcoded to 0.0818192. - : @return inverse isometric latitude in radians - :) -declare %private function geoproj:proj-phi2($ts as xs:double, $e as xs:double) as xs:double -{ - let $phi := math:pi() div 2 - 2 * math:atan($ts) - return - geoproj:proj-phi2-helper(15, $ts, $e, ($phi)) -}; - -(:~ - : Inverse projection from cartesian coordinates on Oblique Mercator cylinder - : to geographic coordinates lat-long on WGS84 ellipsoid.
- : The parameters for center point and scale should be the same as for the initial forward projection, - : otherwise you will get wrong results.
- :
- :
- : @param $lat_0 is the latitude for center point, in degrees (-90, 90) - : @param $long_c is the longitude for center point, in degrees (-180, 180) - : @param $k0 is the scale in the center point. - : @param $coords a sequence of nodes of type
- : <coord><x>x</x><y>y</y></coord>
- : in namespace "http://www.zorba-xquery.com/modules/geoproj-param"
- : The coordinates are expressed in meters. - : - : @error err:XQDY0027 if any of the coordinates passed in the $coords parameter is - : not valid according to the schema. - : - : @return a sequence of geographic coordinates in format
- : <latlong><lat>latitude degree</lat><long>longitude degree</long></latlong>
- : in namespace "http://www.zorba-xquery.com/modules/geoproj-param"
- : Note that the longitude corresponds to the x coordinate, and the latitude to the y coordinate.
- @example test/Queries/geo/geoproj2.xq - @example test/Queries/geo/geoproj7.xq - @example test/Queries/geo/geoproj11.xq - :) -declare function geoproj:omerc-to-wgs84($lat-0 as xs:double, - $long-c as xs:double, - $k0 as xs:double, - $coords as element(geoproj-param:coord)*) as element(geoproj-param:latlong)* -{ - let $validated-coords := - (for $coord in $coords - return - if(empty($coords)) then - $coord - else - validate{$coord} ) - return - geoproj:omerc-to-wgs84-validated($lat-0, $long-c, $k0, $validated-coords) -}; - -declare %private function geoproj:omerc-to-wgs84-validated($lat_0 as xs:double, - $long_c as xs:double, - $k0 as xs:double, - $coords as element(geoproj-param:coord, geoproj-param:coordType)*) as element(geoproj-param:latlong)* -{ - let $e as xs:double := 0.0818192E0 - let $e2 := $e*$e - let $phi0 := geoproj:deg-to-rad($lat_0) - let $lambda0 := geoproj:deg-to-rad($long_c) - let $sin_phi0 := math:sin($phi0) - let $sin2_phi0 := $sin_phi0 * $sin_phi0 - let $cos_phi0 := math:cos($phi0) - let $aphi0 := abs($phi0) - let $B := if ($aphi0 gt 1.e-10) then math:sqrt(1 + $e2 div (1 - $e2) * math:pow($cos_phi0, 4)) else math:sqrt(1 - $e2) - let $A := if ($aphi0 gt 1.e-10) then $B * $k0 * math:sqrt(1 - $e2) div (1 - $e2*$sin2_phi0) else $k0 - let $t0 := geoproj:proj-tsfn($phi0) - let $D := if ($aphi0 gt 1.e-10) then $B * math:sqrt(1 - $e2) div ($cos_phi0 * math:sqrt(1 - $e2*$sin2_phi0)) else 1 - let $D := if ($D*$D < 1) then 1 else $D - let $F := if ($aphi0 gt 1.e-10) then if ($phi0 < 0) then $D - math:sqrt($D*$D - 1) else $D + math:sqrt($D*$D - 1) else 1 - let $E := if ($aphi0 gt 1.e-10) then math:pow($t0, $B) * $F else 1 - - let $G := ($F - 1 div $F) div 2 - let $uc := abs($A div $B * math:atan2(math:sqrt($D*$D - 1), 1)) - let $uc := if ($phi0 < 0) then -$uc else $uc - - for $coord in $coords - let $x := $coord/*:x div 6378137 - let $y := $coord/*:y div 6378137 - let $v := $x - let $u := $y + $uc - let $Qp := math:exp(-$B * $v div $A) - let $Sp := ($Qp - 1 div $Qp) div 2 - let $Tp := ($Qp + 1 div $Qp) div 2 - let $Vp := math:sin($B * $u div $A) - let $Up := $Vp div $Tp - return - if(abs(abs($Up) - 1) lt 1e-10) then - if ($Up gt 0) then - 90 {$long_c} - else - -90 {$long_c} - else - let $phi := $E div math:sqrt((1 + $Up) div (1 - $Up)) - let $phi := geoproj:proj-phi2(math:pow($phi, 1 div $B), $e) - let $lambda := - 1 div $B * math:atan2($Sp, math:cos($B * $u div $A)) - return - {geoproj:rad-to-deg($phi)} {geoproj:rad-to-deg($lambda+$lambda0)} -}; - -(:~ - : Inverse projection from cartesian coordinates on Oblique Mercator cylinder - : to geographic coordinates lat-long on WGS84 ellipsoid.
- : This is an intermediate function for omerc-to-wgs84.
- : The difference is that it works with coordinates in gml:pos format, - : gml being the prefix for the GML namespace "http://www.opengis.net/gml".
- :
- : @param $lat_0 is the latitude for center point, in degrees (-90, 90) - : @param $long_c is the longitude for center point, in degrees (-180, 180) - : @param $k0 is the scale in the center point. - : @param $gmlposs a sequence of nodes of type
- : <gml:pos>x y</gml:pos>
- : in namespace "http://www.opengis.net/gml" - : @return a sequence of geographic coordinates in format
v - : <latlong><lat>latitude degree</lat><long>longitude degree</long></latlong>
- : in namespace "http://www.zorba-xquery.com/modules/geoproj-param" - @example test/Queries/geo/geoproj4.xq - :) -declare function geoproj:omerc-gmlpos-to-wgs84($lat_0 as xs:double, - $long_c as xs:double, - $k0 as xs:double, - $gmlposs as element(gml:pos)*) as element(geoproj-param:latlong)* -{ - geoproj:omerc-to-wgs84($lat_0, $long_c, $k0, - (for $gmlpos in $gmlposs - let $xystring := normalize-space(fn:string($gmlpos)) - let $xy := tokenize($xystring, "[ \t\r\n]+") - let $x := $xy[1] - let $y := $xy[2] - return {$x}{$y})) -}; - -(:~ - : Convertion from Degrees-Minutes-Seconds (DMS) to Degrees.
- : The values for DMS can be like 11d12'13", meaning 11 degrees, 12 minutes and 13 seconds.
- : One degree has 60 minutes, and one minute has 60 seconds.
- : The separator for degrees can be one of the characters [dDoO].
- : The separator for minutes can be one of the characters ['m].
- : The separator for seconds can be " or nothing.
- : The seconds can be a floating point number.
- :
- : The seconds can be missing, and if it is missing, the minutes can be missing too.
- : The negative value can be expressed as -11d12'13" or 11d12'13"S or 11d12'13"W. - : Values for N (North) and E (East) are positive, and S (South) and W (West) are negative. - :
- : @param $dms the degree-minutes-seconds string expressed in the format described above - : @return the value in degrees - @example test/Queries/geo/dms1.xq - :) -declare function geoproj:dms-to-deg($dms as xs:string) as xs:double -{ - let $dms := normalize-space($dms) - let $dtok := tokenize($dms, "([DdOo])|([SNEW]$)") - let $d := $dtok[1] cast as xs:double - let $dsign := if($d < 0) then -1 else 1 - let $d := abs($d) - return - if(count($dtok) eq 1) then - $dsign*$d - else - if(string-length($dtok[2]) eq 0) then - if(matches($dms, "[SW]$")) then - -$d - else - $dsign*$d - else - let $ms := substring($dms, string-length($dtok[1]) + 1 + 1) - let $mtok := tokenize($ms, "(['m])|([SNEW]$)") - let $m := abs($mtok[1] cast as xs:double) - let $d := $d + $m div 60 - return - if(count($mtok) eq 1) then - $dsign*$d - else - if(string-length($mtok[2]) eq 0) then - if(matches($dms, "[SW]$")) then - -$d - else - $dsign*$d - else - let $ss := substring($ms, string-length($mtok[1]) + 1 + 1) - let $stok := tokenize($ss, '"|([SNEW]$)') - let $s := abs($stok[1] cast as xs:double) - let $d := $d + $s div 3600 - return - if(matches($dms, "[SW]$")) then - -$d - else - $dsign*$d -}; - -(:~ - : Convertion from Degrees to Degrees-Minutes-Seconds (DMS).
- :
- : @param $deg the degree value - : @return the value in DMS format, [-]degreedminutes'seconds - @example test/Queries/geo/dms2.xq - :) -declare function geoproj:deg-to-dms($deg as xs:double) as xs:string -{ - let $d := $deg cast as xs:integer - let $ms := abs($deg - $d) * 60 - let $m := $ms cast as xs:integer - let $s := $ms - $m - let $s := $s * 60 - let $m := if($s ge (60 - 1e-10)) then $m + 1 else $m - let $d := if($m ge (60 - 1e-10)) then $d + 1 else $d - let $m := if($m ge (60 - 1e-10)) then $m - 60 else $m - let $s := if($s ge (60 - 1e-10)) then 0 else $s - return - concat($d, "d", $m, "'", $s) -}; diff -Nru zorba-geoproj-module-2.9.1/src/geoproj-param.xsd zorba-geoproj-module-3.0.0/src/geoproj-param.xsd --- zorba-geoproj-module-2.9.1/src/geoproj-param.xsd 1970-01-01 00:00:00.000000000 +0000 +++ zorba-geoproj-module-3.0.0/src/geoproj-param.xsd 2013-11-07 17:16:50.000000000 +0000 @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -Nru zorba-geoproj-module-2.9.1/src/geoproj.xq zorba-geoproj-module-3.0.0/src/geoproj.xq --- zorba-geoproj-module-2.9.1/src/geoproj.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-geoproj-module-3.0.0/src/geoproj.xq 2013-11-07 17:16:50.000000000 +0000 @@ -0,0 +1,516 @@ +xquery version "3.0"; + +(: + : Copyright 2006-2009 The FLWOR Foundation. + : + : Licensed under the Apache License, Version 2.0 (the "License"); + : you may not use this file except in compliance with the License. + : You may obtain a copy of the License at + : + : http://www.apache.org/licenses/LICENSE-2.0 + : + : Unless required by applicable law or agreed to in writing, software + : distributed under the License is distributed on an "AS IS" BASIS, + : WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + : See the License for the specific language governing permissions and + : limitations under the License. +:) + +(:~ + :

Geographic projection module.

+ :

Forward and inverse projection from WGS84 lat-long coordinates to Oblique Mercator x-y projection.

+ :

Oblique Mercator projection is a sphere to cylinder projection.

+ :

This projection results in a conformal output, meaning the shape of small areas is preserved, + : no matter the distance from the origin. But it is not equal area, meaning the area size increases heavily + : when getting closer to North or South. The area size increases with the same amount on x and y axes, + : so the relative shape remains almost the same.

+ :

Mercator projection is the oldest projection, and it is still widely used because it produces a rectangular map.

+ :

This projection is used in Google Maps because of its conformal output.

+ :

For military or measurements purposes the UTM projection is used (or variants). This splits the Earth into small + : areas and computes the cartesian coordinates relative to each area.

+ :

+ :

Here we use Oblique Mercator projection. Its advantage over the normal Mercator is that you can set the tangent point + : between the cylinder and the sphere to be anywhere on Earth. So you can set the center of the map to be close + : to the area you want projected and be able to measure accurately the distances between points and lines.

+ :

The map deformation is minimal close to the center point and close to the "equator" line.

+ :

The advantage over the UTM projection is that it can also produce a global rectangular map, like Mercator, + : which is great for viewing.

+ :

The disadvantage over Mercator is that it needs more processing power.

+ :

+ :

WGS84 is the ellipsoid aproximation of the Earth, with big radius of 6,378,137 m and small radius of 6,356,752.3 m.

+ :

The geographic coordinates expressed for this ellipsoid are widely used today in maps and gps coordinates.

+ :

It is the default standard for representing geographic coordinates.

+ :

+ :

The purpose of this module is to provide convertion from polar to cartesian coordinates, so you can + : process the geographic data with the Simple Features API functions implemented in the geo module.

+ :

That module works only with cartesian coordinates, but most maps have polar coordinates.

+ :

+ :

The projection formulas are taken from lib_proj library and implemented in XQuery.

+ : + : @author Daniel Turcanu + : @project Zorba/Geo Projection/Geo Projection + :) +module namespace geoproj = "http://zorba.io/modules/geoproj"; + +(:~ + :

W3C Math namespace URI.

+:) +declare namespace math="http://www.w3.org/2005/xpath-functions/math"; + +declare namespace err = "http://www.w3.org/2005/xqt-errors"; + +(:~ + :

Import module for checking if geoproj parameters are validated.

+ :) +import module namespace schemaOptions = "http://zorba.io/modules/schema"; + + +(:~ + :

Contains the definitions of the geoproj parameters.

+ :) +import schema namespace geoproj-param = "http://zorba.io/modules/geoproj-param"; + +declare namespace gml="http://www.opengis.net/gml"; + +declare namespace ver = "http://zorba.io/options/versioning"; +declare option ver:module-version "1.0"; + +(:~ + :

Convert angle from degrees to radians.

+ :

The parameter is first reduced to value range of (-360, 360).

+ : + : @param $deg angle in degrees + : @return value in radians (-2PI, 2PI) + :) +declare function geoproj:deg-to-rad($deg as xs:double) as xs:double +{ + ($deg mod 360) * 2 * math:pi() div 360 +}; + +(:~ + :

Convert angle from radians to degrees.

+ : + : @param $rad value in radians + : @return value in degrees (-360, 360) + :) +declare function geoproj:rad-to-deg($rad as xs:double) as xs:double +{ + ($rad * 360 div 2 div math:pi()) mod 360 +}; + + +(:~ + :

Compute the isometric latitude of $phi latitude.

+ : + : @param $phi a latitude + : @return isometric latitude in radians + :) +declare %private function geoproj:proj-tsfn($phi as xs:double) as xs:double +{ + let $e as xs:double := 0.0818192E0 + return + math:tan(math:pi() div 4 - $phi div 2) div math:pow((1 - $e * math:sin($phi)) div (1 + $e * math:sin($phi)), $e div 2) +}; + +declare %private function geoproj:wgs84-to-omerc-validated( + $lat_0 as xs:double, + $long_c as xs:double, + $k0 as xs:double, + $lat_long_degrees as element(geoproj-param:latlong, geoproj-param:latlongType)*) as element(geoproj-param:coord)* +{ + let $e as xs:double := 0.0818192E0 + let $e2 := $e*$e + let $phi0 := geoproj:deg-to-rad($lat_0) + let $lambda0 := geoproj:deg-to-rad($long_c) + let $sin_phi0 := math:sin($phi0) + let $sin2_phi0 := $sin_phi0 * $sin_phi0 + let $cos_phi0 := math:cos($phi0) + let $aphi0 := abs($phi0) + let $B := if ($aphi0 gt 1e-10) then math:sqrt(1 + $e2 div (1 - $e2) * math:pow($cos_phi0, 4)) else math:sqrt(1 - $e2) + let $A := if ($aphi0 gt 1e-10) then $B * $k0 * math:sqrt(1 - $e2) div (1 - $e2*$sin2_phi0) else $k0 + let $t0 := geoproj:proj-tsfn($phi0) + let $D := if ($aphi0 gt 1e-10) then $B * math:sqrt(1 - $e2) div ($cos_phi0 * math:sqrt(1 - $e2*$sin2_phi0)) else 1 + let $D := if ($D*$D < 1) then 1 else $D + let $F := if ($aphi0 gt 1e-10) then if ($phi0 < 0) then $D - math:sqrt($D*$D - 1) else $D + math:sqrt($D*$D - 1) else 1 + let $E := if ($aphi0 gt 1e-10) then math:pow($t0, $B) * $F else 1 + + let $G := ($F - 1 div $F) div 2 + let $uc := abs($A div $B * math:atan2(math:sqrt($D*$D - 1), 1)) + let $uc := if ($phi0 < 0) then -$uc else $uc + + for $latlong in $lat_long_degrees + let $phi := geoproj:deg-to-rad($latlong/*:lat) + let $lambda := geoproj:deg-to-rad($latlong/*:long) + let $V := math:sin($B * ($lambda - $lambda0)) + return + if (abs($phi) lt (math:pi() div 2 - 1.e-10)) then + let $Q := $E div math:pow(geoproj:proj-tsfn($phi) , $B) + let $S := ($Q - 1 div $Q) div 2 + let $T := ($Q + 1 div $Q) div 2 + let $U := -$V div $T + let $v := if (abs($U) ne 1) then $A div (2 * $B) * math:log((1 - $U) div (1 + $U)) else 1 div 0 + let $M := math:cos($B * ($lambda - $lambda0)) + let $u := if ($M gt 1e-7) then $A div $B * math:atan2($S, $M) else $A*$B*($lambda - $lambda0) + let $u := $u - $uc + let $x := $v + let $x := $x * 6378137 + let $y := $u + let $y := $y * 6378137 + return {$x} {$y} + else + let $v := $A div $B * -4.2897288031186085136750723197195 + let $u := $phi * $A div $B + let $u := $u - $uc + let $x := $v + let $x := $x * 6378137 + let $y := $u + let $y := $y * 6378137 + return {$x} {$y} +}; + +(:~ + :

Forward projection from geographic coordinates lat-long on WGS84 ellipsoid to Oblique Mercator cylinder.

+ :

The Oblique Mercator projection is like the standard Mercator projection, but you can choose the point of origin.

+ :

Specify the coordinates of the center point somewhere near the points being projected, + : so the projection deformation is small.

+ :

The azimuth in the center point, alpha, is hardcoded to zero, so the true north is preserved.

+ :

This is a simplification of the standard Oblique Mercator projection.

+ :

Gamma, the azimuth of the rectified bearing of center line is also zero, calculated from alpha.

+ :

+ :

The radius of the Earth in WGS84 is 6378137 m.

+ :

Reverse flatening 298.257223563.

+ :

Eccentricity e 0.0818192.

+ : + : @param $lat_0 is the latitude for center point, in degrees (-90, 90) + : @param $long_c is the longitude for center point, in degrees (-180, 180) + : @param $k0 is the scale in the center point. The scale will increase when going far to north and south. + : Use value 1 to get the true distances between points, in meters. + : At equator, the distance for 1 degree is aproximately 110 km. + : @param $lat_long_degrees a sequence of nodes of type + : <latlong><lat>latitude degree</lat><long>longitude degree</long></latlong> + : in namespace "http://zorba.io/modules/geoproj-param". Each node in the sequence is validated + : against the according schema. + : + : @error err:XQDY0027 if any of the nodes passed in the $lat-long-degress parameter is + : not valid according to the schema. + : + : @return a sequence of x-y coordinates in format + : <coord><x>x</x><y>y</y></coord> + : in namespace "http://zorba.io/modules/geoproj-param" + : Note that the x coordinate corresponds to the longitude, and y coordinate to the latitude. + : The coordinates are expressed in meters. + : The coordinates are relative to the center point. + @example test/Queries/geo/geoproj1.xq + @example test/Queries/geo/geoproj5.xq + @example test/Queries/geo/geoproj6.xq + @example test/Queries/geo/geoproj8.xq + @example test/Queries/geo/geoproj9.xq + @example test/Queries/geo/geoproj10.xq + @example test/Queries/geo/geoproj12.xq + :) +declare function geoproj:wgs84-to-omerc( $lat-0 as xs:double, + $long-c as xs:double, + $k0 as xs:double, + $lat-long-degrees as element(geoproj-param:latlong)*) as element(geoproj-param:coord)* +{ + let $validated-lat-long := + (for $lat-long-degree in $lat-long-degrees + return + if(empty($lat-long-degree)) then + $lat-long-degrees + else + validate{$lat-long-degree} ) + return + geoproj:wgs84-to-omerc-validated($lat-0, $long-c, $k0, $validated-lat-long) +}; + + +(:~ + :

Forward projection from geographic coordinates lat-long on WGS84 ellipsoid to Oblique Mercator cylinder.

+ :

This is an intermediate function for wgs84-to-omerc.

+ :

The difference is that it returns the x-y coordinates in gml:pos format, + : gml being the prefix for the GML namespace "http://www.opengis.net/gml".

+ : + : @param $lat_0 is the latitude for center point, in degrees (-90, 90) + : @param $long_c is the longitude for center point, in degrees (-180, 180) + : @param $k0 is the scale in the center point. + : @param $lat_long_degrees a sequence of nodes of type + : <latlong><lat>latitude degree</lat><long>longitude degree</long></latlong> + : in namespace "http://zorba.io/modules/geoproj-param". Each node in this sequence is validated according + : to the according schema. + : + : @error err:XQDY0027 if any of the nodes passed in the $lat-long-degress parameter is + : not valid according to the schema. + : + : @return a sequence of x-y coordinates in format + : <gml:pos>x y</gml:pos> + : in namespace "http://www.opengis.net/gml" + @example test/Queries/geo/geoproj3.xq + :) +declare function geoproj:wgs84-to-omerc-gmlpos( $lat-0 as xs:double, + $long-c as xs:double, + $k0 as xs:double, + $lat-long-degrees as element(geoproj-param:latlong)*) as element(gml:pos)* +{ + let $validated-lat-long := + (for $lat-long-degree in $lat-long-degrees + return + if(empty($lat-long-degree)) then + $lat-long-degrees + else + validate{$lat-long-degree} ) + return + geoproj:wgs84-to-omerc-gmlpos-validated($lat-0, $long-c, $k0, $validated-lat-long) +}; + +declare %private function geoproj:wgs84-to-omerc-gmlpos-validated( $lat_0 as xs:double, + $long_c as xs:double, + $k0 as xs:double, + $lat_long_degrees as element(geoproj-param:latlong, geoproj-param:latlongType)*) as element(gml:pos)* +{ + for $coord in geoproj:wgs84-to-omerc($lat_0, $long_c, $k0, $lat_long_degrees) + return + {string($coord/*:x)}{" "}{string($coord/*:y)} +}; + +(:~ + :

Function for iterative computing of the inverse isometric latitude.

+ : + : @param $i the maximum iterations + : @param $ts precomputed value + : @param $e the Earth eccentricity. For WGS84 is hardcoded to 0.0818192. + : @param $prev_phi previous computed inverse isometric latitude + : @return isometric latitude in radians + :) +declare %private function geoproj:proj-phi2-helper($i as xs:integer, + $ts as xs:double , $e as xs:double, + $prev_phi as xs:double) as xs:double +{ + if($i eq 0) then + $prev_phi + else + let $phi := math:pi() div 2 - 2 * math:atan($ts * math:pow((1 - $e * math:sin($prev_phi[1])) div (1 + $e * math:sin($prev_phi[1])), $e div 2)) + return + if (abs($prev_phi - $phi) le 1.0e-10) then + $phi + else + geoproj:proj-phi2-helper($i - 1, $ts, $e, $phi) +}; + +(:~ + :

Function for computing the inverse isometric latitude.

+ : + : @param $ts precomputed value, based on an initial latitude. + : @param $e the Earth eccentricity. For WGS84 is hardcoded to 0.0818192. + : @return inverse isometric latitude in radians + :) +declare %private function geoproj:proj-phi2($ts as xs:double, $e as xs:double) as xs:double +{ + let $phi := math:pi() div 2 - 2 * math:atan($ts) + return + geoproj:proj-phi2-helper(15, $ts, $e, ($phi)) +}; + +(:~ + :

Inverse projection from cartesian coordinates on Oblique Mercator cylinder + : to geographic coordinates lat-long on WGS84 ellipsoid.

+ :

The parameters for center point and scale should be the same as for the initial forward projection, + : otherwise you will get wrong results.

+ : + : + : @param $lat_0 is the latitude for center point, in degrees (-90, 90) + : @param $long_c is the longitude for center point, in degrees (-180, 180) + : @param $k0 is the scale in the center point. + : @param $coords a sequence of nodes of type + : <coord><x>x</x><y>y</y></coord> + : in namespace "http://zorba.io/modules/geoproj-param" + : The coordinates are expressed in meters. + : + : @error err:XQDY0027 if any of the coordinates passed in the $coords parameter is + : not valid according to the schema. + : + : @return a sequence of geographic coordinates in format + : <latlong><lat>latitude degree</lat><long>longitude degree</long></latlong> + : in namespace "http://zorba.io/modules/geoproj-param" + : Note that the longitude corresponds to the x coordinate, and the latitude to the y coordinate. + @example test/Queries/geo/geoproj2.xq + @example test/Queries/geo/geoproj7.xq + @example test/Queries/geo/geoproj11.xq + :) +declare function geoproj:omerc-to-wgs84($lat-0 as xs:double, + $long-c as xs:double, + $k0 as xs:double, + $coords as element(geoproj-param:coord)*) as element(geoproj-param:latlong)* +{ + let $validated-coords := + (for $coord in $coords + return + if(empty($coords)) then + $coord + else + validate{$coord} ) + return + geoproj:omerc-to-wgs84-validated($lat-0, $long-c, $k0, $validated-coords) +}; + +declare %private function geoproj:omerc-to-wgs84-validated($lat_0 as xs:double, + $long_c as xs:double, + $k0 as xs:double, + $coords as element(geoproj-param:coord, geoproj-param:coordType)*) as element(geoproj-param:latlong)* +{ + let $e as xs:double := 0.0818192E0 + let $e2 := $e*$e + let $phi0 := geoproj:deg-to-rad($lat_0) + let $lambda0 := geoproj:deg-to-rad($long_c) + let $sin_phi0 := math:sin($phi0) + let $sin2_phi0 := $sin_phi0 * $sin_phi0 + let $cos_phi0 := math:cos($phi0) + let $aphi0 := abs($phi0) + let $B := if ($aphi0 gt 1.e-10) then math:sqrt(1 + $e2 div (1 - $e2) * math:pow($cos_phi0, 4)) else math:sqrt(1 - $e2) + let $A := if ($aphi0 gt 1.e-10) then $B * $k0 * math:sqrt(1 - $e2) div (1 - $e2*$sin2_phi0) else $k0 + let $t0 := geoproj:proj-tsfn($phi0) + let $D := if ($aphi0 gt 1.e-10) then $B * math:sqrt(1 - $e2) div ($cos_phi0 * math:sqrt(1 - $e2*$sin2_phi0)) else 1 + let $D := if ($D*$D < 1) then 1 else $D + let $F := if ($aphi0 gt 1.e-10) then if ($phi0 < 0) then $D - math:sqrt($D*$D - 1) else $D + math:sqrt($D*$D - 1) else 1 + let $E := if ($aphi0 gt 1.e-10) then math:pow($t0, $B) * $F else 1 + + let $G := ($F - 1 div $F) div 2 + let $uc := abs($A div $B * math:atan2(math:sqrt($D*$D - 1), 1)) + let $uc := if ($phi0 < 0) then -$uc else $uc + + for $coord in $coords + let $x := $coord/*:x div 6378137 + let $y := $coord/*:y div 6378137 + let $v := $x + let $u := $y + $uc + let $Qp := math:exp(-$B * $v div $A) + let $Sp := ($Qp - 1 div $Qp) div 2 + let $Tp := ($Qp + 1 div $Qp) div 2 + let $Vp := math:sin($B * $u div $A) + let $Up := $Vp div $Tp + return + if(abs(abs($Up) - 1) lt 1e-10) then + if ($Up gt 0) then + 90 {$long_c} + else + -90 {$long_c} + else + let $phi := $E div math:sqrt((1 + $Up) div (1 - $Up)) + let $phi := geoproj:proj-phi2(math:pow($phi, 1 div $B), $e) + let $lambda := - 1 div $B * math:atan2($Sp, math:cos($B * $u div $A)) + return + {geoproj:rad-to-deg($phi)} {geoproj:rad-to-deg($lambda+$lambda0)} +}; + +(:~ + :

Inverse projection from cartesian coordinates on Oblique Mercator cylinder + : to geographic coordinates lat-long on WGS84 ellipsoid.

+ :

This is an intermediate function for omerc-to-wgs84.

+ :

The difference is that it works with coordinates in gml:pos format, + : gml being the prefix for the GML namespace "http://www.opengis.net/gml".

+ : + : @param $lat_0 is the latitude for center point, in degrees (-90, 90) + : @param $long_c is the longitude for center point, in degrees (-180, 180) + : @param $k0 is the scale in the center point. + : @param $gmlposs a sequence of nodes of type + : <gml:pos>x y</gml:pos> + : in namespace "http://www.opengis.net/gml" + : @return a sequence of geographic coordinates in format v + : <latlong><lat>latitude degree</lat><long>longitude degree</long></latlong> + : in namespace "http://zorba.io/modules/geoproj-param" + @example test/Queries/geo/geoproj4.xq + :) +declare function geoproj:omerc-gmlpos-to-wgs84($lat_0 as xs:double, + $long_c as xs:double, + $k0 as xs:double, + $gmlposs as element(gml:pos)*) as element(geoproj-param:latlong)* +{ + geoproj:omerc-to-wgs84($lat_0, $long_c, $k0, + (for $gmlpos in $gmlposs + let $xystring := normalize-space(fn:string($gmlpos)) + let $xy := tokenize($xystring, "[ \t\r\n]+") + let $x := $xy[1] + let $y := $xy[2] + return {$x}{$y})) +}; + +(:~ + :

Convertion from Degrees-Minutes-Seconds (DMS) to Degrees.

+ :

The values for DMS can be like 11d12'13", meaning 11 degrees, 12 minutes and 13 seconds.

+ :

One degree has 60 minutes, and one minute has 60 seconds.

+ :

The separator for degrees can be one of the characters [dDoO].

+ :

The separator for minutes can be one of the characters ['m].

+ :

The separator for seconds can be " or nothing.

+ :

The seconds can be a floating point number.

+ :

+ :

The seconds can be missing, and if it is missing, the minutes can be missing too.

+ :

The negative value can be expressed as -11d12'13" or 11d12'13"S or 11d12'13"W.

+ :

Values for N (North) and E (East) are positive, and S (South) and W (West) are negative.

+ : + : @param $dms the degree-minutes-seconds string expressed in the format described above + : @return the value in degrees + @example test/Queries/geo/dms1.xq + :) +declare function geoproj:dms-to-deg($dms as xs:string) as xs:double +{ + let $dms := normalize-space($dms) + let $dtok := tokenize($dms, "([DdOo])|([SNEW]$)") + let $d := $dtok[1] cast as xs:double + let $dsign := if($d < 0) then -1 else 1 + let $d := abs($d) + return + if(count($dtok) eq 1) then + $dsign*$d + else + if(string-length($dtok[2]) eq 0) then + if(matches($dms, "[SW]$")) then + -$d + else + $dsign*$d + else + let $ms := substring($dms, string-length($dtok[1]) + 1 + 1) + let $mtok := tokenize($ms, "(['m])|([SNEW]$)") + let $m := abs($mtok[1] cast as xs:double) + let $d := $d + $m div 60 + return + if(count($mtok) eq 1) then + $dsign*$d + else + if(string-length($mtok[2]) eq 0) then + if(matches($dms, "[SW]$")) then + -$d + else + $dsign*$d + else + let $ss := substring($ms, string-length($mtok[1]) + 1 + 1) + let $stok := tokenize($ss, '"|([SNEW]$)') + let $s := abs($stok[1] cast as xs:double) + let $d := $d + $s div 3600 + return + if(matches($dms, "[SW]$")) then + -$d + else + $dsign*$d +}; + +(:~ + :

Convertion from Degrees to Degrees-Minutes-Seconds (DMS).

+ : + : @param $deg the degree value + : @return the value in DMS format, [-]degreedminutes'seconds + @example test/Queries/geo/dms2.xq + :) +declare function geoproj:deg-to-dms($deg as xs:double) as xs:string +{ + let $d := $deg cast as xs:integer + let $ms := abs($deg - $d) * 60 + let $m := $ms cast as xs:integer + let $s := $ms - $m + let $s := $s * 60 + let $m := if($s ge (60 - 1e-10)) then $m + 1 else $m + let $d := if($m ge (60 - 1e-10)) then $d + 1 else $d + let $m := if($m ge (60 - 1e-10)) then $m - 60 else $m + let $s := if($s ge (60 - 1e-10)) then 0 else $s + return + concat($d, "d", $m, "'", $s) +}; diff -Nru zorba-geoproj-module-2.9.1/test/ExpQueryResults/geo/geoproj1.xml.res zorba-geoproj-module-3.0.0/test/ExpQueryResults/geo/geoproj1.xml.res --- zorba-geoproj-module-2.9.1/test/ExpQueryResults/geo/geoproj1.xml.res 2013-05-30 16:37:14.000000000 +0000 +++ zorba-geoproj-module-3.0.0/test/ExpQueryResults/geo/geoproj1.xml.res 2013-11-07 17:16:50.000000000 +0000 @@ -1,5 +1,5 @@ - + 109292.73684961209 110793.18638310062 \ No newline at end of file diff -Nru zorba-geoproj-module-2.9.1/test/ExpQueryResults/geo/geoproj10.xml.res zorba-geoproj-module-3.0.0/test/ExpQueryResults/geo/geoproj10.xml.res --- zorba-geoproj-module-2.9.1/test/ExpQueryResults/geo/geoproj10.xml.res 2013-05-30 16:37:14.000000000 +0000 +++ zorba-geoproj-module-3.0.0/test/ExpQueryResults/geo/geoproj10.xml.res 2013-11-07 17:16:50.000000000 +0000 @@ -1,9 +1,9 @@ - + 0 -110618.44951571905 - + 0 2.3223354824420721E6 \ No newline at end of file diff -Nru zorba-geoproj-module-2.9.1/test/ExpQueryResults/geo/geoproj11.xml.res zorba-geoproj-module-3.0.0/test/ExpQueryResults/geo/geoproj11.xml.res --- zorba-geoproj-module-2.9.1/test/ExpQueryResults/geo/geoproj11.xml.res 2013-05-30 16:37:14.000000000 +0000 +++ zorba-geoproj-module-3.0.0/test/ExpQueryResults/geo/geoproj11.xml.res 2013-11-07 17:16:50.000000000 +0000 @@ -1,5 +1,5 @@ - + -11.000065662385046 0 \ No newline at end of file diff -Nru zorba-geoproj-module-2.9.1/test/ExpQueryResults/geo/geoproj12.xml.res zorba-geoproj-module-3.0.0/test/ExpQueryResults/geo/geoproj12.xml.res --- zorba-geoproj-module-2.9.1/test/ExpQueryResults/geo/geoproj12.xml.res 2013-05-30 16:37:14.000000000 +0000 +++ zorba-geoproj-module-3.0.0/test/ExpQueryResults/geo/geoproj12.xml.res 2013-11-07 17:16:50.000000000 +0000 @@ -1,9 +1,9 @@ - + 34417.375607682858 -6.7723638717972031E6 - + 38106.644879161235 8.983207725162318E6 \ No newline at end of file diff -Nru zorba-geoproj-module-2.9.1/test/ExpQueryResults/geo/geoproj2.xml.res zorba-geoproj-module-3.0.0/test/ExpQueryResults/geo/geoproj2.xml.res --- zorba-geoproj-module-2.9.1/test/ExpQueryResults/geo/geoproj2.xml.res 2013-05-30 16:37:14.000000000 +0000 +++ zorba-geoproj-module-3.0.0/test/ExpQueryResults/geo/geoproj2.xml.res 2013-11-07 17:16:50.000000000 +0000 @@ -1,5 +1,5 @@ - + 11 11 \ No newline at end of file diff -Nru zorba-geoproj-module-2.9.1/test/ExpQueryResults/geo/geoproj4.xml.res zorba-geoproj-module-3.0.0/test/ExpQueryResults/geo/geoproj4.xml.res --- zorba-geoproj-module-2.9.1/test/ExpQueryResults/geo/geoproj4.xml.res 2013-05-30 16:37:14.000000000 +0000 +++ zorba-geoproj-module-3.0.0/test/ExpQueryResults/geo/geoproj4.xml.res 2013-11-07 17:16:50.000000000 +0000 @@ -1,5 +1,5 @@ - + 11 11 \ No newline at end of file diff -Nru zorba-geoproj-module-2.9.1/test/ExpQueryResults/geo/geoproj5.xml.res zorba-geoproj-module-3.0.0/test/ExpQueryResults/geo/geoproj5.xml.res --- zorba-geoproj-module-2.9.1/test/ExpQueryResults/geo/geoproj5.xml.res 2013-05-30 16:37:14.000000000 +0000 +++ zorba-geoproj-module-3.0.0/test/ExpQueryResults/geo/geoproj5.xml.res 2013-11-07 17:16:50.000000000 +0000 @@ -1,5 +1,5 @@ - + 109292.73684961209 110793.18638310062 \ No newline at end of file diff -Nru zorba-geoproj-module-2.9.1/test/ExpQueryResults/geo/geoproj6.xml.res zorba-geoproj-module-3.0.0/test/ExpQueryResults/geo/geoproj6.xml.res --- zorba-geoproj-module-2.9.1/test/ExpQueryResults/geo/geoproj6.xml.res 2013-05-30 16:37:14.000000000 +0000 +++ zorba-geoproj-module-3.0.0/test/ExpQueryResults/geo/geoproj6.xml.res 2013-11-07 17:16:50.000000000 +0000 @@ -1,9 +1,9 @@ - + 547086.3150955874 115174.5700163616 - + 545150.00927157491 226184.45457291827 \ No newline at end of file diff -Nru zorba-geoproj-module-2.9.1/test/ExpQueryResults/geo/geoproj7.xml.res zorba-geoproj-module-3.0.0/test/ExpQueryResults/geo/geoproj7.xml.res --- zorba-geoproj-module-2.9.1/test/ExpQueryResults/geo/geoproj7.xml.res 2013-05-30 16:37:14.000000000 +0000 +++ zorba-geoproj-module-3.0.0/test/ExpQueryResults/geo/geoproj7.xml.res 2013-11-07 17:16:50.000000000 +0000 @@ -1,9 +1,9 @@ - + 11 102 - + 12 102 \ No newline at end of file diff -Nru zorba-geoproj-module-2.9.1/test/ExpQueryResults/geo/geoproj8.xml.res zorba-geoproj-module-3.0.0/test/ExpQueryResults/geo/geoproj8.xml.res --- zorba-geoproj-module-2.9.1/test/ExpQueryResults/geo/geoproj8.xml.res 2013-05-30 16:37:14.000000000 +0000 +++ zorba-geoproj-module-3.0.0/test/ExpQueryResults/geo/geoproj8.xml.res 2013-11-07 17:16:50.000000000 +0000 @@ -1,9 +1,9 @@ - + -218616.56181767309 111339.45363464409 - + -217845.99308707233 222020.3879810845 \ No newline at end of file diff -Nru zorba-geoproj-module-2.9.1/test/ExpQueryResults/geo/geoproj9.xml.res zorba-geoproj-module-3.0.0/test/ExpQueryResults/geo/geoproj9.xml.res --- zorba-geoproj-module-2.9.1/test/ExpQueryResults/geo/geoproj9.xml.res 2013-05-30 16:37:14.000000000 +0000 +++ zorba-geoproj-module-3.0.0/test/ExpQueryResults/geo/geoproj9.xml.res 2013-11-07 17:16:50.000000000 +0000 @@ -1,5 +1,5 @@ - + 0 -221150.04824675474 \ No newline at end of file diff -Nru zorba-geoproj-module-2.9.1/test/Queries/geo/dms1.xq zorba-geoproj-module-3.0.0/test/Queries/geo/dms1.xq --- zorba-geoproj-module-2.9.1/test/Queries/geo/dms1.xq 2013-05-30 16:37:14.000000000 +0000 +++ zorba-geoproj-module-3.0.0/test/Queries/geo/dms1.xq 2013-11-07 17:16:50.000000000 +0000 @@ -1,4 +1,4 @@ -import module namespace geoproj = "http://www.zorba-xquery.com/modules/geoproj"; +import module namespace geoproj = "http://zorba.io/modules/geoproj"; (geoproj:dms-to-deg("10d10'10"), geoproj:dms-to-deg("10d"), diff -Nru zorba-geoproj-module-2.9.1/test/Queries/geo/dms2.xq zorba-geoproj-module-3.0.0/test/Queries/geo/dms2.xq --- zorba-geoproj-module-2.9.1/test/Queries/geo/dms2.xq 2013-05-30 16:37:14.000000000 +0000 +++ zorba-geoproj-module-3.0.0/test/Queries/geo/dms2.xq 2013-11-07 17:16:50.000000000 +0000 @@ -1,4 +1,4 @@ -import module namespace geoproj = "http://www.zorba-xquery.com/modules/geoproj"; +import module namespace geoproj = "http://zorba.io/modules/geoproj"; (geoproj:deg-to-dms(10.169444444444444), geoproj:deg-to-dms(10), diff -Nru zorba-geoproj-module-2.9.1/test/Queries/geo/geoproj1.xq zorba-geoproj-module-3.0.0/test/Queries/geo/geoproj1.xq --- zorba-geoproj-module-2.9.1/test/Queries/geo/geoproj1.xq 2013-05-30 16:37:14.000000000 +0000 +++ zorba-geoproj-module-3.0.0/test/Queries/geo/geoproj1.xq 2013-11-07 17:16:50.000000000 +0000 @@ -1,5 +1,5 @@ -import module namespace geoproj = "http://www.zorba-xquery.com/modules/geoproj"; -declare namespace geoproj-param = "http://www.zorba-xquery.com/modules/geoproj-param"; +import module namespace geoproj = "http://zorba.io/modules/geoproj"; +declare namespace geoproj-param = "http://zorba.io/modules/geoproj-param"; geoproj:wgs84-to-omerc(10, 10, 1, diff -Nru zorba-geoproj-module-2.9.1/test/Queries/geo/geoproj10.xq zorba-geoproj-module-3.0.0/test/Queries/geo/geoproj10.xq --- zorba-geoproj-module-2.9.1/test/Queries/geo/geoproj10.xq 2013-05-30 16:37:14.000000000 +0000 +++ zorba-geoproj-module-3.0.0/test/Queries/geo/geoproj10.xq 2013-11-07 17:16:50.000000000 +0000 @@ -1,5 +1,5 @@ -import module namespace geoproj = "http://www.zorba-xquery.com/modules/geoproj"; -declare namespace geoproj-param = "http://www.zorba-xquery.com/modules/geoproj-param"; +import module namespace geoproj = "http://zorba.io/modules/geoproj"; +declare namespace geoproj-param = "http://zorba.io/modules/geoproj-param"; geoproj:wgs84-to-omerc(-11, 0, 1, ( diff -Nru zorba-geoproj-module-2.9.1/test/Queries/geo/geoproj11.xq zorba-geoproj-module-3.0.0/test/Queries/geo/geoproj11.xq --- zorba-geoproj-module-2.9.1/test/Queries/geo/geoproj11.xq 2013-05-30 16:37:14.000000000 +0000 +++ zorba-geoproj-module-3.0.0/test/Queries/geo/geoproj11.xq 2013-11-07 17:16:50.000000000 +0000 @@ -1,5 +1,5 @@ -import module namespace geoproj = "http://www.zorba-xquery.com/modules/geoproj"; -declare namespace geoproj-param = "http://www.zorba-xquery.com/modules/geoproj-param"; +import module namespace geoproj = "http://zorba.io/modules/geoproj"; +declare namespace geoproj-param = "http://zorba.io/modules/geoproj-param"; geoproj:omerc-to-wgs84(-10, 0, 1, ( diff -Nru zorba-geoproj-module-2.9.1/test/Queries/geo/geoproj12.xq zorba-geoproj-module-3.0.0/test/Queries/geo/geoproj12.xq --- zorba-geoproj-module-2.9.1/test/Queries/geo/geoproj12.xq 2013-05-30 16:37:14.000000000 +0000 +++ zorba-geoproj-module-3.0.0/test/Queries/geo/geoproj12.xq 2013-11-07 17:16:50.000000000 +0000 @@ -1,5 +1,5 @@ -import module namespace geoproj = "http://www.zorba-xquery.com/modules/geoproj"; -declare namespace geoproj-param = "http://www.zorba-xquery.com/modules/geoproj-param"; +import module namespace geoproj = "http://zorba.io/modules/geoproj"; +declare namespace geoproj-param = "http://zorba.io/modules/geoproj-param"; geoproj:wgs84-to-omerc(-11, 169, 1, ( diff -Nru zorba-geoproj-module-2.9.1/test/Queries/geo/geoproj2.xq zorba-geoproj-module-3.0.0/test/Queries/geo/geoproj2.xq --- zorba-geoproj-module-2.9.1/test/Queries/geo/geoproj2.xq 2013-05-30 16:37:14.000000000 +0000 +++ zorba-geoproj-module-3.0.0/test/Queries/geo/geoproj2.xq 2013-11-07 17:16:50.000000000 +0000 @@ -1,5 +1,5 @@ -import module namespace geoproj = "http://www.zorba-xquery.com/modules/geoproj"; -declare namespace geoproj-param = "http://www.zorba-xquery.com/modules/geoproj-param"; +import module namespace geoproj = "http://zorba.io/modules/geoproj"; +declare namespace geoproj-param = "http://zorba.io/modules/geoproj-param"; geoproj:omerc-to-wgs84(10, 10, 1, ( diff -Nru zorba-geoproj-module-2.9.1/test/Queries/geo/geoproj3.xq zorba-geoproj-module-3.0.0/test/Queries/geo/geoproj3.xq --- zorba-geoproj-module-2.9.1/test/Queries/geo/geoproj3.xq 2013-05-30 16:37:14.000000000 +0000 +++ zorba-geoproj-module-3.0.0/test/Queries/geo/geoproj3.xq 2013-11-07 17:16:50.000000000 +0000 @@ -1,5 +1,5 @@ -import module namespace geoproj = "http://www.zorba-xquery.com/modules/geoproj"; -declare namespace geoproj-param = "http://www.zorba-xquery.com/modules/geoproj-param"; +import module namespace geoproj = "http://zorba.io/modules/geoproj"; +declare namespace geoproj-param = "http://zorba.io/modules/geoproj-param"; geoproj:wgs84-to-omerc-gmlpos(10, 10, 1 div 1000, diff -Nru zorba-geoproj-module-2.9.1/test/Queries/geo/geoproj4.xq zorba-geoproj-module-3.0.0/test/Queries/geo/geoproj4.xq --- zorba-geoproj-module-2.9.1/test/Queries/geo/geoproj4.xq 2013-05-30 16:37:14.000000000 +0000 +++ zorba-geoproj-module-3.0.0/test/Queries/geo/geoproj4.xq 2013-11-07 17:16:50.000000000 +0000 @@ -1,4 +1,4 @@ -import module namespace geoproj = "http://www.zorba-xquery.com/modules/geoproj"; +import module namespace geoproj = "http://zorba.io/modules/geoproj"; declare namespace gml="http://www.opengis.net/gml"; geoproj:omerc-gmlpos-to-wgs84(10, 10, 1 div 1000, diff -Nru zorba-geoproj-module-2.9.1/test/Queries/geo/geoproj5.xq zorba-geoproj-module-3.0.0/test/Queries/geo/geoproj5.xq --- zorba-geoproj-module-2.9.1/test/Queries/geo/geoproj5.xq 2013-05-30 16:37:14.000000000 +0000 +++ zorba-geoproj-module-3.0.0/test/Queries/geo/geoproj5.xq 2013-11-07 17:16:50.000000000 +0000 @@ -1,5 +1,5 @@ -import module namespace geoproj = "http://www.zorba-xquery.com/modules/geoproj"; -declare namespace geoproj-param = "http://www.zorba-xquery.com/modules/geoproj-param"; +import module namespace geoproj = "http://zorba.io/modules/geoproj"; +declare namespace geoproj-param = "http://zorba.io/modules/geoproj-param"; geoproj:wgs84-to-omerc(10, 100, 1, diff -Nru zorba-geoproj-module-2.9.1/test/Queries/geo/geoproj6.xq zorba-geoproj-module-3.0.0/test/Queries/geo/geoproj6.xq --- zorba-geoproj-module-2.9.1/test/Queries/geo/geoproj6.xq 2013-05-30 16:37:14.000000000 +0000 +++ zorba-geoproj-module-3.0.0/test/Queries/geo/geoproj6.xq 2013-11-07 17:16:50.000000000 +0000 @@ -1,5 +1,5 @@ -import module namespace geoproj = "http://www.zorba-xquery.com/modules/geoproj"; -declare namespace geoproj-param = "http://www.zorba-xquery.com/modules/geoproj-param"; +import module namespace geoproj = "http://zorba.io/modules/geoproj"; +declare namespace geoproj-param = "http://zorba.io/modules/geoproj-param"; geoproj:wgs84-to-omerc(10, 85, 1, ( diff -Nru zorba-geoproj-module-2.9.1/test/Queries/geo/geoproj7.xq zorba-geoproj-module-3.0.0/test/Queries/geo/geoproj7.xq --- zorba-geoproj-module-2.9.1/test/Queries/geo/geoproj7.xq 2013-05-30 16:37:14.000000000 +0000 +++ zorba-geoproj-module-3.0.0/test/Queries/geo/geoproj7.xq 2013-11-07 17:16:50.000000000 +0000 @@ -1,5 +1,5 @@ -import module namespace geoproj = "http://www.zorba-xquery.com/modules/geoproj"; -declare namespace geoproj-param = "http://www.zorba-xquery.com/modules/geoproj-param"; +import module namespace geoproj = "http://zorba.io/modules/geoproj"; +declare namespace geoproj-param = "http://zorba.io/modules/geoproj-param"; geoproj:omerc-to-wgs84(10, 100, 1, ( diff -Nru zorba-geoproj-module-2.9.1/test/Queries/geo/geoproj8.xq zorba-geoproj-module-3.0.0/test/Queries/geo/geoproj8.xq --- zorba-geoproj-module-2.9.1/test/Queries/geo/geoproj8.xq 2013-05-30 16:37:14.000000000 +0000 +++ zorba-geoproj-module-3.0.0/test/Queries/geo/geoproj8.xq 2013-11-07 17:16:50.000000000 +0000 @@ -1,5 +1,5 @@ -import module namespace geoproj = "http://www.zorba-xquery.com/modules/geoproj"; -declare namespace geoproj-param = "http://www.zorba-xquery.com/modules/geoproj-param"; +import module namespace geoproj = "http://zorba.io/modules/geoproj"; +declare namespace geoproj-param = "http://zorba.io/modules/geoproj-param"; geoproj:wgs84-to-omerc(10, -100, 1, ( diff -Nru zorba-geoproj-module-2.9.1/test/Queries/geo/geoproj9.xq zorba-geoproj-module-3.0.0/test/Queries/geo/geoproj9.xq --- zorba-geoproj-module-2.9.1/test/Queries/geo/geoproj9.xq 2013-05-30 16:37:14.000000000 +0000 +++ zorba-geoproj-module-3.0.0/test/Queries/geo/geoproj9.xq 2013-11-07 17:16:50.000000000 +0000 @@ -1,5 +1,5 @@ -import module namespace geoproj = "http://www.zorba-xquery.com/modules/geoproj"; -declare namespace geoproj-param = "http://www.zorba-xquery.com/modules/geoproj-param"; +import module namespace geoproj = "http://zorba.io/modules/geoproj"; +declare namespace geoproj-param = "http://zorba.io/modules/geoproj-param"; geoproj:wgs84-to-omerc(0, 0, 1, (