|
|
@@ -72,10 +72,15 @@ class Route_UrlAction_WmsGenerate extends RouteBase {
|
|
|
foreach ($DataSources as $DataSource) {
|
|
|
$DataSourceArr=explode('|',$DataSource);
|
|
|
$DataSource=$DataSourceArr[0];
|
|
|
- $file=basename($DataSource,".shp");
|
|
|
- foreach ($suffixes as $suffix) {
|
|
|
- if(is_file($destFolderPath."/".$file.$suffix)) $filesToCopy[]=$file.$suffix;
|
|
|
- else $missingFiles[]=$file.$suffix;
|
|
|
+ $pathinfo = pathinfo($DataSource);
|
|
|
+ if (in_array($pathinfo['extension'], array("tif","tiff","TIF","TIFF"))) {
|
|
|
+ $filesToCopy[] = basename($DataSource);
|
|
|
+ } else {
|
|
|
+ $file=basename($DataSource,".shp");
|
|
|
+ foreach ($suffixes as $suffix) {
|
|
|
+ if(is_file($destFolderPath."/".$file.$suffix)) $filesToCopy[]=$file.$suffix;
|
|
|
+ else $missingFiles[]=$file.$suffix;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
if ($missingFiles) throw new Exception('Nie znaleziono poniższych plików wymaganych przez plik projetku QGIS:<br/>'.implode('<br/>',$missingFiles));
|
|
|
@@ -358,7 +363,7 @@ openOnFocus: false
|
|
|
//$mapLayer->datasource=$destFolderPath.'/.wms/'.basename($mapLayer->datasource);
|
|
|
$bash='
|
|
|
tmp=`mktemp -d`
|
|
|
-/opt/local/bin/ogr2ogr -s_srs EPSG:'.$mapLayer->srs->spatialrefsys->srid.' -t_srs EPSG:4236 "$tmp/tmp.shp" "'.$mapLayer->datasource.'" >/dev/null 2>&1
|
|
|
+/opt/local/bin/ogr2ogr -s_srs EPSG:'.$mapLayer->srs->spatialrefsys->srid.' -t_srs EPSG:4326 "$tmp/tmp.shp" "'.$mapLayer->datasource.'" >/dev/null 2>&1
|
|
|
extent=`/opt/local/bin/ogrinfo -al -so "$tmp/tmp.shp" | grep Extent | sed "s/[(),\-]//g;s/ / /g;s/Extent: //g"`
|
|
|
echo "${extent} "
|
|
|
rm -rf $tmp
|
|
|
@@ -418,7 +423,7 @@ rm -rf $tmp
|
|
|
WMS_TITLE "__NAME__"
|
|
|
WMS_ENABLE_REQUEST "*"
|
|
|
# WMS_ONLINERESOURCE "https://__SERVER_NAME__/wms/.single/__ID__"
|
|
|
- MS_ONLINERESOURCE "http://127.0.0.1:34580/wms/.single/__ID__"
|
|
|
+ WMS_ONLINERESOURCE "http://127.0.0.1:34580/wms/.single/__ID__"
|
|
|
WMS_SRS "EPSG:__EPSG__"
|
|
|
END
|
|
|
END
|
|
|
@@ -603,7 +608,7 @@ END
|
|
|
END
|
|
|
|
|
|
PROJECTION
|
|
|
- "init=epsg:4236"
|
|
|
+ "init=epsg:4326"
|
|
|
END
|
|
|
';
|
|
|
$mapHeadSearch=array('__NAME__','__MAP_URL__','__EPSGS__');
|