Point-Mapping Extension

GISWiki - Das freie Portal für Geoinformatik (GIS)
Wechseln zu: Navigation, Suche


This Point-Mapping Extension (MapPoint) combines a referenced image / map and point-coordinates. The result is a geo-referenced map with a geo-referenced point.

Über eine Extension können Punktkoordinaten mit georeferenzierten Karten verbunden werden. Diese Möglichkeit wird mit der Point-Mapping_Extension gezeigt. Eine zuvor hochgeladene Deutschlandkarte, wie sie in vielen Artikeln zur Veranschaulichung von Ortschaften genutzt wird, wird mittels einer MediaWiki-Extension georeferenziert. Zusammen mit den ebenfalls an die Extension übergebenen Punktkoordinaten wird eine Karte generiert, in der die Lage des Punktes angezeigt wird.

Features

  • Georeferenzierung einer Karte
  • Darstellung eines Lagepunktes mittels geographischer Koordinaten
  • Darstellung beliebig vieler Punkte
  • Verknüpfung des Punktes mit einem beliebigen Link
  • Hinweisfenster beim Überfahren des Punktes mit der Maus

Installation

siehe Quellcode

Parameter

  • [] - ist bezogen auf das eigentlich angezeigte Bild
 * $varURLMap: URL der Karte/Image-URL (z.B.: "http://www.giswiki.org/images/c/c1/DeutschlandRef.png";)
 * $varURLPoint: URL des Punktsymbols / Symbolimage-URL(z.B.: "http://www.giswiki.org/images/1/1b/Reddot.gif";)
 * $varMapWidth: = gewünschte Kartenbreite / desired width of the map
 * $PointExt: Punktsymbolgröße / desired symbol-size
 * $A: Meters/Pixel in horizontaler x östlicher Richtung / meters/pixel in horizontal x Easting direction
 * $E: Meters/Pixel in verticaler y nördlicher Richtung / meters/pixel in vertical y Northing direction
 * $C: x Easting UTM coordinate of center of upper left pixel in meters
 * $F: y Northing UTM coordinate of center of upper left pixel in meters
  • {}- ist bezogen auf Punktkoordinaten (davon können Sie soviel setzen wie sie wollen)
 * $varPointLon: Punktkoordinate (Geographische Länge) / point coordinates - Longitude
 * $varPointLat: Punktkoordinate (Geographische Breite) / point coordinates - Latitude
 * $varHRef: Link (optional)
 * $varTitle (=$varAlz): Für Hinweise (Mousover) und das <alt> tag (optional) / for hints and the <alt> tag


See Samples for input of parameters.


Links

Bugs

  • a png-Image did not get displayed in IE-Explorer (http://www.giswiki.org/images/b/b0/DeutschlandGeoref.png)
    It works when using http://www.giswiki.org/images/e/e1/DeutschlandRef.jpg

To Do's

  • Übergabe mehrere Punkte
  • Kombination mit einer Vorlage (??)
  • Parameterübergabe in mehreren Zeilen
  • Punkte mit URL verbinden
  • Externes URLSymbol (External.png) per CSS verschwinden lassen
  • Hinweistext und Alternativtext für Punkte
  • Punkte überlagern sich und Informationen werden nicht dargestellt.

Hinzufügen neuer Punkte

Hier finden sie weitere Informationen zur Verwendung der Point-Mapping Extension Für die Anlage neuer Karten lesen sie bitte den dortigen Text.

Das unten anfgefügte Beispiel zeigt fett markiert einen neuen Punkt der in der Karte DE-CH-AT_ref.jpg dargestellt werden soll. Neue Punkte werden in geschweiften Klammern eingeschlossen {...}.

Als Angaben sind:

  • die Geographische Länge und die
  • Geographische Breite erforderlich. Beide in dezimalen Gradangaben !
  • Ein Link sowie
  • ein beschreibener Text kann optional hinzugefügt werden.

Beispiel

<MapPoints>
[
http://www.giswiki.org/images/2/29/DE-CH-AT_ref.jpg
http://www.giswiki.org/images/9/92/Bluedot.gif
10
200
0.014105171975
-0.008989824183
5.809850000000
54.997352777778
]
{
11.5750
48.1400
http://de.wikipedia.org/wiki/München
München
}
{
11.6167
52.1333
http://www.geolock.de
GEOLOCK GmbH
}
</MapPoints>

Wie ermittele ich die Koordinaten eines Ortes etc. ...?

  • Mittels des Tools hjl_get_CoorM lassen sich die Koordinaten aus den Google Maps ermitteln. Für den deutschsprachigen Bereich sind allerdings nur Satelittenbilder verfügbar.
  • Die deutschsprachige Wikipedia hat zu vielen Ortschaften Koordinatenangaben gemacht. Sollten die Koordinaten nicht in dezimalen Gradangaben vorliegen dann folgen sie dem Link (External.png, falls vorhanden), der mit diesen Koordinaten verbunden ist. Das neue Fenster zeigt eine Liste von Kartendiensten, die diese Koordinaten anzeigen. Map24 beispielsweise zeigt dann auch die geographischen Koordinaten.
  • Koordinaten können auch von OpenGeoDB bezogen werden. Einfach auf http://opengeodb.de/suche/ den entsprechenden Ortsnamen eingeben und die dort angezeigten Koordinaten verwenden.

Mein Punkt erscheint nicht - Punkte überlagern sich!

Dies ist ein noch vorhandenes Problem. Es wird an einer Lösung gearbeitet.

Samples

Karte

Beachten sie die Hinweise zum Hinzufügen neuer Punkte in eine Karte.

<MapPoints> [ http://de.giswiki.net/images/2/29/DE-CH-AT_ref.jpg http://de.giswiki.net/images/9/92/Bluedot.gif 10 600 0.014105171975 -0.008989824183 5.809850000000 54.997352777778 ]

{ 8.778323 51.729128 http://www.mettenmeier.de Mettenmeier GmbH } { 16.663 49.207904 http://de.giswiki.net/wiki/BERIT ASSECO Central Europe a.s. (Czech Republic) } { 7.705472 47.531169 http://de.giswiki.net/wiki/BERIT BERIT AG (Schweiz) } { 8.510925 49.4426 http://de.giswiki.net/wiki/BERIT BERIT GmbH (Deutschland) } { 8.68333 50.1167 http://www.geoas.de AGIS GmbH } { 6.641389 49.756667 http://www.alta4.com alta4 Geoinformatik AG } { 6.1056523 50.773573 http://www.ahu.de/ ahu AG - Wasser · Boden · Geomatik } { 7.182492 50.7803347 http://www.supportgis.de CPA Geo-Information } { 7.6538 51.9330 http://www.conterra.de con terra GmbH } { 11.5167 47.9762298 http://www.das-byro.de das byro Marchfeld } { 8.42742 49.01316 http://www.ddsgeo.de DDS Digital Data Services GmbH } { 9.53333 48.7167 http://www.digiterra.de/ DIGITERRA } { 6.358333 50.922222 http://www.geospatial-services.de/ Dr. Neumann Consulting - Geospatial Services } { 9.4429244 51.325717 http://www.inovagis.com iNovaGIS oHG Kassel } { 9.76057 52.3983 http://www.gdf-hannover.de/ GDF Hannover } { 9.71667 52.3667 http://www.entera.de/ entera } { 8.533 47.195 http://www.geozug.ch Gätzi Vescoli AG Baar } { 14.812787 50.890085 http://www.idu.de IDU mbH in Zittau } { 11.616700 52.133300 http://www.geolock.de GEOLOCK GmbH Magdeburg } { 11.342500 48.095770 http://www.wigeogis.de WIGeoGIS GmbH München } { 7.364477 51.304004 http://www.wigeogis.de WIGeoGIS GmbH Dortmund } { 13.022395 47.491763 http://www.wigeogis.at WIGeoGIS GmbH Salzburg } { 13.73688 51.02941 http://www.virtualcitysystems.de virtualcitySYSTEMS GmbH } { 16.231593 48.122702 http://www.wigeogis.at WIGeoGIS GmbH Wien } { 8.392546 50.255995 http://www.punchbyte.de Punchbyte Software } { 8.383135 49.485434 http://www.geoventis.de Geoventis GmbH Darmstadt } { 13.317477 52.664135 http://www.lambdamedia.de Lambda Media } { 8.252003 50.359985 http://www.geoventis.de Geoventis GmbH Asslar } { 9.6055 52.31548 http://www.contelos.de Contelos GmbH } { 7.23 53.59 http://www.norbit.de norBIT GmbH } { 9.81561 52.32038 http://www.raumbezug.eu raumbezug GbR } { 8.7014 49.298 http://www.mysynergis.com SYNERGIS Informationssysteme GmbH } { 16.3667 48.2000 http://www.mysynergis.com SYNERGIS Informationssysteme GmbH } { 11.4000 47.2667 http://www.mysynergis.com SYNERGIS CAD-Info-Systeme GmbH } { 13.0389818 47.823781 http://www.spatial-services.com/ Spatial Services GmbH - Geoinformatiklösungen und Dienste - GIS Consulting } { 9.187839 48.805271 http://www.fit.fichtner.de.de Fichtner IT Consulting } { 7.645011 51.961904 http://www.eftas.com EFTAS Fernerkundung Technologietransfer GmbH } { 9.504933 47.01274 http://www.sourcepole.ch Sourcepole AG } { 12.395206 51.333742 http://www.aphos.de aphos Leipzig AG } { 8.1976891 53.151506 http://omniscale.de Omniscale } { 13.428701 52.489472 http://www.geosysnet.de geoSYS } { 12.395250 51.333740 http://www.gis-mapping.de GIS-Mapping.de } { 9.8665 54.1662 http://www.torr.de torresin & partner } { 11.3278 48.1056 http://www.eagle-eye-earth.com Eagle Eye Earth } { 16.2500 47.8167 http://www.mobilegis.at mobileGIS.at } { 12.11553 54.07479 http://www.gdi-service.de GDI-Service Rostock }

</MapPoints>

Munich and Berlin

<MapPoints>
[
http://www.giswiki.org/images/2/29/DE-CH-AT_ref.jpg
http://www.giswiki.org/images/9/92/Bluedot.gif
10
200
0.014105171975
-0.008989824183
5.809850000000
54.997352777778
]
{
11.5750
48.1400
http://de.wikipedia.org/wiki/München
München
}
{
13.394444
52.516667
http://de.wikipedia.org/wiki/Berlin
Unsere allerliebste Hauptstadt
}
</MapPoints>

<MapPoints> [ http://www.giswiki.org/images/2/29/DE-CH-AT_ref.jpg http://www.giswiki.org/images/9/92/Bluedot.gif 10 200 0.014105171975 -0.008989824183 5.809850000000 54.997352777778 ] { 11.5750 48.1400 http://de.wikipedia.org/wiki/München München } { 13.394444 52.516667 http://de.wikipedia.org/wiki/Berlin Unsere allerliebste Hauptstadt } </MapPoints>

Munich - using the bavarian flag

<MapPoints>
[
http://www.giswiki.org/images/e/e1/DeutschlandRef.jpg
http://upload.wikimedia.org/wikipedia/commons/a/a3/Flag_de-bayern_lozenge.png
15
144
0.028662571242
-0.017977324880
5.499161111111
55.115925000000
]
{
11.5750
48.1400
http://de.wikipedia.org/wiki/München
Dies ist die Hauptstadt von Bayern
}
</MapPoints>

<MapPoints> [ http://www.giswiki.org/images/e/e1/DeutschlandRef.jpg http://upload.wikimedia.org/wikipedia/commons/a/a3/Flag_de-bayern_lozenge.png 6 144 0.028662571242 -0.017977324880 5.499161111111 55.115925000000 ] { 11.5750 48.1400 http://de.wikipedia.org/wiki/München Dies ist die Hauptstadt von Bayern } </MapPoints>

Berlin - using a bigger symbol

<MapPoints>
[
http://www.giswiki.org/images/e/e1/DeutschlandRef.jpg
http://www.giswiki.org/images/1/1b/Reddot.gif
20
140
0.028662571242
-0.017977324880
5.499161111111
55.115925000000
]
{
13.394444
52.516667
http://de.wikipedia.org/wiki/Berlin
Unsere allerliebste Hauptstadt
}
</MapPoints>

<MapPoints> [ http://www.giswiki.org/images/e/e1/DeutschlandRef.jpg http://www.giswiki.org/images/1/1b/Reddot.gif 20 140 0.028662571242 -0.017977324880 5.499161111111 55.115925000000 ] { 13.394444 52.516667 http://de.wikipedia.org/wiki/Berlin Unsere allerliebste Hauptstadt } </MapPoints>

Code

<?php
# MapPoints by Heinz-Josef Lücking h-j.luecking@t-online.de
#
# Copy this text into a file called "MapPoints.php" and save it into the directory "extensions"
# To activate the extension, include it from your LocalSettings.php
# with: include("extensions/MapPoints.php");
# Hint: Do'nt mix up MapPoints with the older version MapPoint!
#
# 
# Licence: "Creative Commons", explicit http://creativecommons.org/licenses/by-sa/2.0/de/deed.en
#  
# visit http://www.giswiki.org
#
# Have fun
#
$wgExtensionFunctions[] = "wfMapPoints";

function wfMapPoints() {
  global $wgParser;
  $wgParser->setHook( "MapPoints", "renderMapPoints" );
}

function renderMapPoints( $input ) {

  #----------------------------------------#
	# Splits input into basic map and points #
  #----------------------------------------#
  $s = $input;
	$s = str_replace("\n\r","|",$s);
	$s = str_replace("\n","|",$s);
	$s = str_replace("\r","|",$s);
	$s = str_replace("[|","[",$s);
	$s = str_replace("|]","]",$s);
	$s = str_replace("{|","{",$s);
	$s = str_replace("|}","}",$s);
	$s = str_replace("]|{","]{",$s);
	$s = str_replace("}|","}",$s);
	
  preg_match_all('/([\[\]{}])(.*?)([\[\]{}])/', $s, $matches, PREG_SET_ORDER);
  # explode
  foreach($matches as $match) {
    $varAr[] = explode('|', $match[2]);
  }
  
  #------
  # MAP #
  #------

  # Image(Map) and Point-file

  $varURLMap   = $varAr[0][0];
  $varURLPoint = $varAr[0][1];
  $PointExt    = $varAr[0][2]; # PointSize (width = height)
   
  # Getting some image-information
   
  $varMapWidth  = $varAr[0][3];              # the width the image should be displayed
  $size         = getimagesize("$varURLMap");# the real size of the image
  $height       = $size[1];                  # real height
  $width        = $size[0];                  # real width
  $varZoom      = $varMapWidth / $width;     # zoom-factor
  $varMapHeigth = $height * $varZoom;        # computed image-heigth
   
  # Georeferencing the image (see http://en.wikipedia.org/wiki/World_file)

  $A = $varAr[0][4];
  $E = $varAr[0][5];
  $C = $varAr[0][6];
  $F = $varAr[0][7];

  #---------
  # POINTS #
  #---------

  foreach($varAr as $k=>$v) {
    if($k>0) {
      $varPointLon = $v[0];
      $varPointLat = $v[1];

      # Calculating the position of the point on the image
  
      $xImg = ((($varPointLon - $C) / $A) * $varZoom) - ($PointExt / 2);
      $yImg = ((($varPointLat - $F) / $E) * $varZoom) - ($PointExt / 2);
      
      # Adding an additional Link to the point;
      if ($v[2] == "")  {$varHRef = "";} else {$varHRef = " href=\"".$v[2]."\"";  }

      # for Hints (Mousover) and the <alt> tag
      if ($v[3] == "") {$varTitle = ""; $varAlt = "";} else {$varTitle = " title=\"".$v[3]."\""; $varAlt = " alt=\"".$v[3]."\"";  }

      # add some random text to <div id="myMapPoints...
      $MapRand = rand(); 

      $aPoint .= "<div id=\"myMapPoints".$MapRand."\" class=\"\" style=\"position: relative; left: 0px; top: 0px; width: 0px; height: 0px; visibility: visible;\"> <a ".$varHRef." ".$varTitle."><img name=\"myMapPoints_\" style=\"opacity: 1.0; position: absolute; top: ".$yImg."px; left: ".$xImg."px;\" src=\"".$varURLPoint."\" height=\"".$PointExt."\" width=\"".$PointExt."\" ".$varAlt." ></a></div>";
    }
  }


  

  #---------------------#
  # Building the output #
  #---------------------#

  $MapRand = rand(); # add some random text to <div id="MapPoints...
  $output = "<div id=\"MapPoints".$MapRand."\" class=\"MapPoints\" style=\"position: relative; left: 0px; top: 0px; width: ".$varMapWidth."px; height: ".$varMapHeigth."px; visibility: visible; background-color: white;\"> <img name=\"myMap\" style=\"position: absolute; top: 0pt; left: 0pt;\" src=\"".$varURLMap."\" height=\"".$varMapHeigth."\" width=\"".$varMapWidth."\"> ".$aPoint."</div>";

  return $output;
}
?>

Siehe auch

Einsatz der Extension


Lizenz

"Creative Commons", und zwar explizit die Namensnennung-NichtKommerziell-Weitergabe unter gleichen Bedingungen 2.0 Deutschland http://www.giswiki.org/images/f/f1/CreativeCommond_logo_trademark.gif

Share Maps

Whithin GISWiki you can share georeferenced Images. See Shared Images with world file data for a list of available Maps.

Following Images/Maps are available:

Deutschlandkarte / Germany
Deutschland, Schweiz und Österreich