source: subversion/applications/utils/import/gml2osm/cs2cs_wrapper.php @ 5763

Last change on this file since 5763 was 3721, checked in by isortega, 13 years ago

Added gml2osm import utility - use it when importing data from GML format.
It's able to reuse nodes/segments, and translates a subset of the EGM data dictionary into OSM map features.

  • Property svn:executable set to *
File size: 755 bytes
Line 
1<?php
2
3/// Wrapper para cs2cs - permite convertir un array de coordenadas a otro array de coordenadas.
4
5/// FIXME: escape shell args
6function cs2cs($x,$y,$srs_in='epsg:4258',$srs_out='epsg:4326')
7{
8        $r = shell_exec("echo \"$x $y\" | cs2cs -f %.20f +init=$srs_in +to +init=$srs_out");
9        sscanf($r,"%f %f",$x,$y);
10        return (array($x,$y));
11}
12
13
14function epsg4230_to_latlong($x,$y)
15{
16        return cs2cs($x,$y,'epsg:4230');
17}
18
19
20function epsg4258_to_latlong($x,$y)
21{
22        return cs2cs($x,$y,'epsg:4258');
23}
24
25// $r = utm31_to_latlong(438899.6,4591936.33);
26// print_r($r);
27//
28// $r = utm31_to_latlong(442426.69,4596424.53);
29// print_r($r);
30
31// $r = epsg4230_to_latlong(-6.59729,43.52425);
32// $r = epsg4258_to_latlong(-3.710829858779907,40.44465952237447);
33// print_r($r);
34
35?>
Note: See TracBrowser for help on using the repository browser.