View Single Post
Posts: 2 | Thanked: 1 time | Joined on Apr 2011
#59
With the following patch and the latest fetch_map_v30l i was able to get the limit of cadastral units (kiinteistörajat) to my Maemo Mapper on N810.
The usage is like orto but word orto is replaced by ktjraja
for example URL:
http://YourServerIP/MapDir/map.py?ktjraja/%0d/%d/%d.png
or
http://YourServerIP/MapDir/map.py?kt.../%0d/%d/%d.png
Code:
--- map.py.ori	2011-04-08 15:59:56.000000000 +0300
+++ map.py	2011-04-27 09:13:11.000000000 +0300
@@ -39,6 +39,14 @@
        orto = 1
        SERVICE_CODE = 'kkp2'
 
+    ktjraja = 0
+    if SERVICE_CODE == 'ktjraja':
+       ktjraja = 1
+       SERVICE_CODE = 'kkp'
+    elif SERVICE_CODE == 'ktjraja2':
+       ktjraja = 1
+       SERVICE_CODE = 'kkp2'
+
     # Kansalaisen karttapaikka
     if SERVICE_CODE == 'kkp':
        if z < z_levels_kkp[0] or z > z_levels_kkp[1]:
@@ -87,6 +95,9 @@
     if( orto ):
         fmservice.HandleParameter("--orto")
 
+    if( ktjraja ):
+        fmservice.HandleParameter("--ktjraja")
+
     (COORDTYPE, C_E, C_N) = fmservice.TranslateToServiceCoordinatesXY(COORDTYPE, c_coords['E'], c_coords['N'])
     (im, ozi_map_data) = Fetch_And_Return_Map(fmservice, COORDTYPE, C_N, C_E, size, size, parameters)
 
@@ -125,7 +136,7 @@
     in_ds.SetGCPs( gcp_list, in_ds.GetProjection() )
 
     out_srs = osr.SpatialReference()
-    out_srs.ImportFromEPSG(900913)
+    out_srs.ImportFromEPSG(3857)
     out_ds = gdal.AutoCreateWarpedVRT( in_ds, in_srs.ExportToWkt(), out_srs.ExportToWkt() )
 
     gt = out_ds.GetGeoTransform()