• I need this translated (Deutsch)
    3 replies, posted
[b]So everything below this sentence is in German and I need to know what it says (in english).[/b] Akkurat skalierte SC4-Regionen mit DEM-Daten und 16bit-PNGs SimCity 4 bietet bekanntlich die Möglichkeit, eigene Regionen auf der Basis von Graustufenbildern zu erstellen. Dagegen ist weniger bekannt, dass digitale Höhenmodelle (DEM: Digital Elevation Model) für fast jedes Fleckchen Erde kostenlos im Internet zur Verfügung stehen, die sich – mit ein bisschen Übung – in 16bit-Graustufenbilder und daher auch in akkurat skalierte SC4-Regionen verwandeln lassen. Wie das geht, wird im folgenden Tutorial Schritt für Schritt gezeigt. INHALT 1. Einführung und Grundlagen 2. DEM-Daten und woher man sie bekommt 3. Exkurs: 8bit- und 16bit-Graustufenbilder im Vergleich 4. Projektion und Skalierung 5. Vom DEM zum 16bit-PNG 6. Import in SC4 und Nachbearbeitung ACHTUNG: Folgende Programme werden benötigt, um das Tutorial nachvollziehen zu können: GDAL – Geospatial Data Abstraction Library (link zum Download für Windows (ca. 4MB): [url]http://download.osgeo.org/gdal/win32...in32exe160.zip[/url]) 3DEM - Visualizatin Software (Download-Link ist im Text kurz unterhalb der Kartendarstellung) ein einfaches Programm zur Bildbearbeitung bspw. IrfanView SC4Mapper Außerdem hilfreich aber nicht unbedingt erforderlich sind SC4Terraformer eine schnelle Internetverbindung, Grundkenntnisse im Umgang mit der Windows-Shell und ein bisschen mathematisches Grundverständnis Geändert von toja (16.11.2009 um 16:53 Uhr) toja ist offline Mit Zitat antworten Alt 03.11.2009, 19:40 #2 toja Member SimForum BAT Team Registriert seit: Okt 2008 Einführung und Grundlagen Vor jedem neuen SimCity 4-Spiel stellt sich zunächst einmal die Frage nach der richtigen Region. Sicherlich spielt bei der Auswahl die Ästhetik eine große Rolle, eine abwechslungsreiche Region mit einem schönen Terrain-Mod kann schon für sich allein eine Augenweide sein. Allerdings geht die Bedeutung einer Region weit über ihre ästhetische Qualität hinaus, denn durch die Beschaffenheit einer Region wird die Infrastruktur einer Stadt maßgeblich mitbestimmt – zumindest wenn man auf ein kleines bisschen realitätsnähe Wert legt und nicht alle 100m Brücken über einen Fluss spannen oder einen Berg wie einen Schweizer Käse mit Tunneln durchlöchern will. Abgesehen von solchen allgemeinen Überlegungen ist natürlich auch die Größe einer Region von Bedeutung, d.h. man sollte sich vor der Erstellung einer (akkurat skalierten) Region über die entsprechenden Größenverhältnisse in SC4 Gedanken machen. So hat bspw. die mit dem Spiel mitgelieferte Region San Francisco über den Daumen geschätzt eine Größe von etwa 4x4 großen Stadtkarten. Würde man die Region entsprechend der realen Größenverhältnisse ins Spiel bringen, kommt man auf etwa 12x12 große Stadtkarten, statt 16 macht das nach Adam Riese 144[!] große Stadtkarten – da haben Rechner und Spieler eine Menge zu tun. Aber wie groß sind denn nun eigentlich die unterschiedlichen Stadtkarten? Nun, jedes Feld in SC4 hat eine Kantenlänge von 16m x 16m. Da die kleine Karte 64 x 64 Felder, die mittlere Karte 128 x 128 Felder und die große Karte 256 x 256 Felder hat, ergibt sich: für die kleine Karte: 1024m x 1024m, für die mittlerer Karte: 2048m x 2048m und für die große Karte: 4096m x 4096m. Mit diesen Informationen ausgestattet kann man sich nun - abhängig von der Größe, die man sich ungefähr vorstellt - via GoogleMaps o.ä. auf die Suche nach einer geeigneten Region machen. Dabei muss die Zukünftige Region aber nicht unbedingt quadratisch sein: Ich habe bspw. mal eine Karte von Turin und Umgebung gemacht, die etwa 28km x 16km groß und mit 28 großen Stadtkarten auch einigermaßen spielbar ist. Geändert von toja (03.11.2009 um 19:48 Uhr) toja ist offline Mit Zitat antworten Alt 03.11.2009, 19:41 #3 toja Member SimForum BAT Team Registriert seit: Okt 2008 DEM-Daten und woher man sie bekommt DEM-Datensätze im Grunde nichts anderes als spezielle Bilddateien im Rastergrafikformat. Der einzige Unterschied besteht darin, dass bei einer normalen Bilddatei jedem Pixel ein bestimmter Farbwert zugeordnet ist, die zusammen ein Gesamtbild ergeben. Bei einem DEM-Datensatz ist statt dessen jedem Pixel eine Zahl zugeordnet, die die entsprechende Höhe des Punktes über dem Meeresspiegel angibt (daher muss in einem DEM-Datensatz zusätzlich die Information gespeichert sein, welcher Teil der Erdoberfläche eigentlich abgebildet ist). Dadurch, dass DEM-Datensätze nichts anderes als Rastergrafiken sind, teilen sie mit anderen Bilddateien die Eigenschaft, eine bestimmte Auflösung zu haben – und je geringer die Auflösung, desto unschärfer das Bild. Ein DEM-Datensatz, der bspw. eine Fläche von 1000m x 1000m darstellt und 100 x 100 Pixel groß ist, hat eine Auflösung von 10m, da alle 10m eine Höheninformation verfügbar ist. Ein Datensatz, der die gleiche Fläche darstellt, dabei allerdings eine Größe von 1000 x 1000 Pixel hat, hätte dagegen eine Auflösung von 1m. Die erste Anlaufstelle, um sich digitale Höhenmodelle (DEM) zu beschaffen, ist The National Map Seamless Server, eine Website, die vom United States Geological Survey (USGS) bereit gestellt wird. Die USGS stellt dort eine ganze Reihe von geographischen Daten kostenlos zum Download bereit, u.a. auch DEM-Daten von allen Teilen der Welt, (leider) allerdings in unterschiedlichen Auflösungen. Für das gesamt Gebiet der USA sind DEM-Daten mit einer Auflösung von 1/3 Bogensekunden verfügbar, das entspricht einem Raster von etwa 10m × 10m, für den kompletten Rest der Welt liegt derzeit leider nur ein Datensatz mit einer Auflösung von 3 Bogensekunden vor, der einem Raster von etwa 90m x 90m entspricht. Öffnet man die o.g. Website erscheint zunächst ein Begrüßungsbildschirm. Dort klickt man auf „View & Download International Data“ (die Daten für die USA gibt’s dort auch) und es erscheint nach einer Weile folgende Benutzeroberfläche: (oben mittig ist der Link zu einem umfangreichen Tutorial angebracht!) Zunächst sollte man rechts auf Download (A) klicken und ein Häkchen bei der richtigen Datenquelle setzten: Für Daten aus den USA 1/3''NED, für den Rest der Welt SRTM Finished 3 arc sec. Anschließend zoomt man mit den entsprechenden Werkzeugen (B) auf diejenige Region, die man sich vorher über GoogleMaps o.ä. ausgeguckt hat. Schließlich wählt man das Downloadwerkzeug (C) aus und zieht mit gedrückter Maustaste ein Rechteck um die entsprechende Region, so dass man sicher ist, die Region auch komplett zu erfassen, woraufhin sich folgendes PopUp-Fenster öffnet: Achtung: Dort klickt man zunächts auf „Modify Data Request“, und wählt als Ausgabeformat „GeoTiff“, anschließend ganz unten auf „Save Changes & Return to Summary“ klicken: Erst danach auf Download klicken und die Daten auf der Festplatte speichen, bis die Daten da sind, dauert es immer eine kleine Weile! Nachdem der Download abgeschlossen ist, kann man sich das Ergebnis mit dem Programm 3DEM schon mal angucken (dazu die .zip Datei entpacken, 3DEM öffnen, als Datenformat GeoTiff und danach die entsprechende Datei auswählen): Wie unschwer zu erkennen, habe ich mir die Region um Genf für das Tutorial ausgesucht. TIP: Für einige Gebirgsregionen außerhalb der USA (z.B. die Alpen) bekommt man auf dieser Seite auch Höhenmodelle mit einer Auflösung von 1 Bogensekunde (~30m). Die Datensätze im .hgt-Format lassen sich mit 3DEM öffnen und von dort als GeoTiff speichern. Geändert von toja (04.11.2009 um 01:01 Uhr) toja ist offline Mit Zitat antworten Alt 03.11.2009, 19:42 #4 toja Member SimForum BAT Team Registriert seit: Okt 2008 Exkurs: 8bit- und 16bit-Graustufenbilder im Vergleich Bevor in den nächsten Kapiteln der kniffelige Teil des Tutorials beginnt, ist es m.E. ganz hilfreich, sich einmal mit den technischen Details zu beschäftigen, die dahinter stehen: Warum sind denn 16bit-PNGs nun eigentlich soviel besser als 8bit-BMPs? Zunächst einmal haben beide Bildformate gemeinsam, dass es sich um Rastergrafikformate handelt, d.h. jedem Pixel wird ein bestimmter (Farb-)Wert zugeordnet. Der wesentliche Unterschied besteht nun darin, wie groß das Intervall ist, in dem diese Werte liegen und eben darüber geben 8 bzw. 16 Bit Auskunft. Um das Ganze etwas bildhafter zu machen, kann man sich ein Bit als Glühbirne vorstellen, die entweder an (1) oder aus ist (0). Stellt man sich acht Glühbirnen nebeneinander vor (8bit) und durchläuft alle möglichen An/Aus-Kombinationen 00000000 00000001 00000010 00000011 ... 11111111 ergeben sich 2^8 = 256 unterschiedliche Kombinationen, d.h. einem Pixel in einem 8bit-BMP lässt sich einer von 256 verschiedene Zahlenwerten zuordnen, wobei 0 der Farbe schwarz und 255 der Farbe weiß entspricht. Bei sechzehn Glühbirnen sieht das Ganze schon ganz anders aus, durchläuft man hier alle An/Aus Kombinationen ergeben sich nämlich 2^16 = 65536 Kombinationsmöglichkeiten, d.h. 0 = schwarz und 65535 = weiß! Um zu verstehen, was das Ganze nun mit SC4-Regionen zu tun hat, muss man sich nur vor Augen führen, dass auch DEM-Daten nichts anderes als Rastergrafiken sind und eben deshalb kann man normale (8bit-)Graustufen-BMPs auch als Höhenmodelle für SC4 verwenden – allerdings sind diese recht ungenau, denn standardmäßig entspricht jeder Farbwert in der BMP-Datei 3 Höhenmetern im Spiel wodurch (1) ein unschöner Treppcheneffekt entsteht und (2) sich eine Geländehöhe von maximal 765m realisieren lässt (denn 255 x 3 = 765). Dank des SC4Mapper ist jedoch glücklicherweise möglich 16bit-PNGs als Grundlage für die Erstellung von Regionen zu verwenden, so dass man sich mit derlei Beschränkungen nicht herumschlagen muss. Im Gegenteil, dort entspricht jeder Farbwert 0,1 Höhenmetern, so dass sich eine Geländehöhe von maximal 6553,5m realisieren lässt! Geändert von toja (04.11.2009 um 00:10 Uhr) toja ist offline Mit Zitat antworten Alt 03.11.2009, 19:43 #5 toja Member SimForum BAT Team Registriert seit: Okt 2008 Projektion und Skalierung SCHRITT 1: PROJEKTION Will man eine akkurat skalierte Region für SC4 erstellen, steht man zunächst vor dem Problem, das die Erde mehr oder weniger kugelförmig ist, während es sich bei der SC4-Welt offenbar um eine unendliche Ebene handelt (oder hat zufällig schon mal jemand eine Region gespielt, an deren Rändern es nicht weiter zur SimNation ging?). Die mathematische Methode, mit der man die gekrümmte Oberfläche der (dreidimensionalen) Erde auf eine (zweidimensionale) Ebene überträgt, nennt man Projektion. Soweit, so gut, nur leider ist die Projektion der DEM-Datensätze für unsere Zwecke nur eingeschränkt brauchbar, denn Längen- und Breitengrade werden hier als kartesisches Koordinatensystem behandelt, wodurch es in Richtung der Polkappen zu immer größeren Verzerrungen kommt, so dass der eigentlich punktförmige Nordpol mal eben eine Ausdehnung hat, die der des Äquators entspricht, nämlich über 40.000km. (Quelle: Wikipedia) Um diese Verzerrung in Karten, die nur einen kleinen Teil der Erdoberfläche abbilden, möglichst gering zu halten, hat sich inzwischen in vielen Bereichen die mit Kartografie zu tun haben das UTM-Koordinatensystem als Quasi-Standard durchgesetzt – und in eben dieses muss man seine DEM-Daten projizieren. Dazu öffnet man seinen Datensatz mit 3DEM und klickt in der Menüleiste auf: Operation->Change Projection->Convert to UTMProjection woraufhin sich ein kleines PopUp-Fenster öffnet in dem man die Gestalt des Erdellipsoids auswählen kann. Für Daten aus den USA (1/3''NED) sollte man NAD83 auswählen, für den Rest der Welt WGS84. Anschließend sollte man noch dafür sorgen, dass evtl. „Löcher“ in den DEM-Daten gestopft werden, dazu klickt man in der Menüleiste auf: Operation->F7 Patch Missing Data und zieht mit gedrückter Maustaste ein Rechteck um den gesamten Datensatz und drückt die RETURN-Taste. (so sieht mein DEM jetzt aus) Der so veränderte Datensatz muss nun zwischengespeichert werden. Um sich später Tipparbeit an der Windows-Shell zu ersparen, sollte man den Datensatz in dem selben Ordner speichern, in den man auch die .exe-Dateien des GDAL-Downloads entpackt hat. Bei mir liegen die GDAL .exe-Dateien unter C:\gdal\bin\ (Spätestens jetzt ist der richtige Moment gekommen sich GDAL zu besorgen und das Paket in ein von der Windows-Shell einfach zu erreichendes Verzeichnis zu entpacken ). Daher speichere ich meinen DEM-Datensatz über File->SaveGeoTiff DEM, klicke auf OK und wähle als Speicherort C:\gdal\bin\ und als Dateinamen Genf_UTM.tif SCHRITT 2: Skalierung Wie oben bereits dargestellt, teilen DEM-Daten mit anderen Bilddateien die Eigenschaft, eine bestimmte Auflösung zu haben, deren Einheit allerdings je nach Projektion des Datensatzes variieren kann. Neben den bereits erwähnten Vorteilen hat die UTM-Projektion den Vorteil, dass die Auflösung hier in Meter gemessen wird, während bei den Original-Daten die Auflösung intern in Grad angegeben ist. Insofern lässt sich die Auflösung unseres modifizierten Datensatzes relativ einfach auf die für SC4 benötigte Auflösung von 16m interpolieren. Zur Verdeutlichung: Wir haben einen DEM-Datensatz (hier sehr stark vergrößert...) und das Höhenmodell einer SC4-Region mit einer Auflösung von 16m. Ziel ist es den DEM-Datensatz (mit einer Auflösung von 10m/USA bzw. 90m/Rest der Welt) so zu interpolieren, dass er dem 16m-Raster von SC4 entspricht: Dazu öffnet man eine Windows-Shell und wechselt mit dem Befehl cd in das Verzeichnis, in dem die GDAL-.exe-Dateien sowie die modifizierten DEM-Daten liegen. Im richtigen Verzeichnis angekommen gibt man dann Folgendes ein: >>> gdalwarp -tr 16 16 -r bilinear quelldatei.tif zieldatei.tif Mit dem Flag -tr 16 16 (target resolution) legt man die Auflösung der Zieldatei fest. Mit dem Fleg -r bilinear legt man die Interpolationsmethode fest. Mit der Einstellung bilinear erreicht man i.d.R. ganz brauchbare Ergebnisse, man kann durchaus aber auch mal andere Einstellungen ausprobieren (mehr dazu in der Online-Dokumentation von GDAL)... Anschließend folgen einfach die Namen der Quell- und Zieldatei, in meinem Fall genf_UTM.tif und genf_UTM_16.tif. Die Angabe von Laufwerksbuchstaben bzw. Pfaden ist nicht notwendig, da meine DEM-Daten ja im selben Verzeichnis liegen, wie die GDAL-.exe-Dateien. Nach drücken der RETURN-Taste sieht das Ganze bei mir so aus: Unter anderem ist zu lesen, dass meine Zieldatei stattliche 4192x4416 Pixel groß ist geworden ist! Alle aufmerksamen Leser können jetzt schon mal nachrechnen, welcher Fläche das entspricht - wie's aussieht sollte ich meine Region erst noch ein bischen zuschneiden, bevor ich mich daran mache mein GeoTiff in ein 16bit-PNG zu verwandeln... Geändert von toja (06.11.2009 um 17:05 Uhr) toja ist offline Mit Zitat antworten Alt 03.11.2009, 19:44 #6 toja Member SimForum BAT Team Registriert seit: Okt 2008 Vom DEM zum 16bit-PNG Die erste Hürde ist schon mal geschafft: Im GDAL-Ordner liegt jetzt ein GeoTiff mit UTM-Projektion und einer Auflösung von 16m. Bevor die DEM-Daten jedoch in ein 16bit-PNG verwandelt werden kann, müssen die Daten zunächst auf eine SC4-kompatible Größe zugeschnitten werden, die freilich nicht vollkommen beliebig ist. Die kleinste Region, die sich für SC4 erstellen lässt, hat die Größe einer kleinen Stadtkarte, alle anderen Regionsgrößen leiten sich daher von dieser Fläche ab. Wie eingangs bereits erwähnt besteht die kleine Stadtkarte aus 64 x 64 Feldern. Weiterhin kann man im vierten und fünften Bild des letzten Abschnitts erkennen, dass diese Felder zwischen den einzelnen Stützpunkten des Höhenmodells aufgespannt sind. Daher benötigt man für eine Region mit 64x64 Feldern auch ein Höhenmodell mit 65 x 65 Stützpunkten. Zugegeben, das hört sich etwas kompliziert an, deshalb habe ich eine kleine Datei angehängt, aus der sich alle möglichen Regionsgrößen bis einschließlich 32km x 32km in Kilometern-Abständen (genauer gesagt 1024m) und die entsprechende Größe des Höhenmodells in Pixeln ablesen lassen (keine Sorge, die habe ich nicht per Hand geschrieben...) Um das modifizierte Höhenmodell nun zu zuschneiden, muss wieder mit GDAL gearbeitet werden, allerdings benötigt das Programm die Information, welcher Teil des DEMs eigentlich ausgeschnitten werden soll. Um diese Information zu erhalten, erstellt man sich zunächst am besten eine Abbildung der DEM-Daten im JPEG-Format: Nachdem man die modifizierten DEM-Daten (genf_UTM_16.tif) mit 3DEM geöffnet hat, klickt man auf Operation->F6 Resize Overhead View woraufhin sich ein kleines Fenster mit einem Schieberegler öffnet, den man so positionieren muss, dass bei Map Scale der Wert 1.00 erscheint, danach auf OK klicken. Das Höhenmodell erscheint jetzt in voller Größe im Ausgabefenster und lässt sich über File->Save Map Image als normale Bilddatei speichern. Der Größe wegen sollte man JPEG wählen, der Speicherort ist diesmal egal, nur wiederfinden sollte man ihn... Anschließend öffnet man diese Datei mit dem Bildbearbeitungsprogramm seiner Wahl, ich verwende im Folgenden IrfanView. Mit dem Auswahlwerkzeug erstellt man nun ein Rechteck, dass annäherungsweise die Größe der zukünftigen Region repräsentiert (siehe angehängte Liste; die Größe auf den Pixel genau festzulegen ist nicht immer möglich, aber auch nicht unbedingt notwendig). So sieht das bei mir aus: Die Informationen mit denen wir GDAL füttern müssen, liefert uns IrfanView in der Programmleiste am oberen Bildrand: Die beiden Zahlen hinter „Selection“ sind die X-Y-Koordinaten der linken oberen Ecke des Auswahlrechtecks, dahinter folgt die Größe der Auswahl. In meinem Fall liege ich mit zwei Pixeln knapp neben der gewünschten Größe von 1537 x 1537, d.h. meine Region wird etwa 24 x 24 km groß sein und 36 große Stadtkarten umfassen. Also dann: Eine Windows-Shell öffnen, in das Verzeichnis der GDAL-.exe-Dateien wechseln, die Struktur des benötigten Befehls sieht folgendermaßen aus: >>>gdal_translate -srcwin X-Offset Y-Offset X-Size Y-Size quelldatei.tif zieldatei.tif Mit dem Flag -srcwin wird offensichtlich die Position und Größe des gewünschten Ausschnitts festgelegt, in meinem Beispiel gebe ich also ein: >>>gdal_translate -srcwin 1182 1505 1537 1537 genf_UTM_16.tif genf_UTM_final.tif Nach dem Drücken von RETURN-Taste, sieht es hoffentlich ungefähr so aus: Halleluja, das Höhenmodell liegt nun endlich mit der richtigen Projektion, Auflösung und Größe vor und ist bereit sich in ein 16bit-PNG zu verwandeln! Das einzige was jetzt noch zu beachten ist, ist die korrekte Umwandlung der Höhendaten in PNG-Werte. Dafür bringt man mit dem Befehl gdalinfo zunächst in Erfahrung, auf welcher Höhe der niedrigste bzw. höchste Punkt des Datensatzes liegt: >>> gdalinfo -mm genf_UTM_final.tif Der niedrigste Punkt (das ist bei mir die Oberfläche des Genfer Sees) liegt also bei 360,51m, der Höchste bei 1474,41m. Zu beachten ist nun, dass des Meeresspiegel in SC4 nicht bei 0m, sondern bei 250m liegt, d.h. auch im PNG sollte der niedrigste Punkt bei 250m liegen. Damit aber sich die Höhendaten auf der Z-Achse nicht verzerren, muss die Höhendifferenz von 110,51m (360,51m - 250m = 110,51m) auch vom höchsten Punkt abgezogen werden, so dass man auf 1363,9m (1474,41m -110,51m = 1363,9m) kommt. Mit diesen Daten kann man sich nun an die Erstellung des 16bit-PNGs machen. Benötigt wird dazu erneut der Befehl gdal_translate mit folgender Struktur: >>>gdal_translate -ot UInt16 -of PNG -scale QuellMin QuellMax ZielMin ZielMax Quelldatei.tif Zieldatei.png Der Flag -ot UInt16 sorgt für eine Ausgabe in 16 Bit, mit dem Flag -of PNG sorgt man freilich für das PNG-Format. Spannend wird's beim Flag -scale, denn hier muss man beachten, dass der zulässige Wertebereich bei einem 16bit-PNG zwischen 0 und 65535 liegt, so dass man die ermittelten Werte mit 10 multiplizieren muss! Mein Befehl sieht daher so aus: >>>gdal_translate -ot UInt16 -of PNG -scale 360.51 1474.41 2500 13639 genf_UTM_final.tif genf_UTM_final.png Et voilà, fertig ist das akkurat skalierte 16bit-PNG! Angehängte Dateien Dateityp: pdf RegionSize.pdf (48,3 KB, 23x aufgerufen) Geändert von toja (07.11.2009 um 01:35 Uhr) toja ist offline Mit Zitat antworten Alt 03.11.2009, 19:45 #7 toja Member SimForum BAT Team Registriert seit: Okt 2008 Import in SC4 und Nachbearbeitung Verglichen mit der Erstellung eines Höhenmodells im 16bit-PNG-Format ist der Import in SC4 mit Hilfe des SC4Mappers denkbar einfach: Nach dem Öffnen des Programms klickt man auf Create Region, in dem sich öffnenden PopUp-Fenster wählt man 16 bit png als Format aus, woraufhin sich ein weiteres PopUp-Fenster öffnet, in dem man seine PNG-Datei als Quelldatei angeben muss. Wenn alles gut gegangen ist, sollten sich die Felder bei Specify size automatisch auf die Größe der Region eingestellt haben. Nun hat man zwei Möglichkeiten: Standardmäßig erstellt der SC4Mapper eine config.bmp die ausschließlich aus kleinen Stadtkarten besteht, alternativ dazu ist es aber auch über die Auswahl der entsprechenden Option möglich, eine benutzerdefinierte config.bmp anzugeben. Nachdem der SC4Mapper das PNG geladen hat, braucht es nur noch einen Klick auf Save Region und einen passenden Namen für die neue Region! In der linken oberen Ecke der Region kann man erkennen, wie sich die Region beim ersten Öffnen mit den automatisch von SC4Mapper erstellten Übersichten darstellt. Aber keine Sorge, nachdem die Stadtkarten einmal geöffnet und gespeichert worden sind, zeigt sich die Region mit dem gewohnten Terrain. Abschließend noch ein paar technische Hinweise: Eines des größten Probleme der DEM-Daten ist sicherlich, dass immer die Oberfläche von Gewässern bzw. die Meeresoberfläche als Daten enthalten sind, d.h. es liegen keine Informationen darüber vor, wie es eigentlich unter der Wasseroberfläche aussieht. Die Folge davon ist, dass man Gewässer, wie in meinem Fall den Genfer See, mit Hilfe der Gott-Modus-Werzeuge oder mit dem SC4Terraformer per Hand ausgraben muss. Das ist mühsam und zeitaufwendig (insbesondere wenn die Karte einen Flusslauf enthält), lässt sich aber leider nicht vermeiden... Ein weiteres Problem ist, dass sich in den DEM-Daten nicht zwangsläufig alle Höheninformationen über dem Meeresspiegel befinden müssen (man denke nur an die Niederlande), so dass sich im besten Fall zwar eine Küstenlinie erkennen lässt, dahinter aber weite Teile der Region unter Wasser liegen. Auch hier ist also Handarbeit gefragt! Schließlich ist noch darauf hinzuweisen, dass eine Region in SC4 nicht beliebig hoch sein kann. Standardmäßig ist die maximale Geländehöhe auf 2500m eingestellt, bei den verschiedenen Terrain-Mods variiert dieser Wert allerdings. Bei Regionen, die sehr große Höhenunterschiede aufweisen, kann es dadurch zu Problemen kommen, wie Wilfried Webber weiter unten recht anschaulich demonstriert hat... Abhilfe schafft in diesen Fällen der High Altitude Patch. Soweit von meiner Seite, jetzt aber viel Spaß beim Regionen erstellen! - toja
Accurately scaled SC4 regions with DEM data and 16-bit PNGs offers SimCity 4 is well known, the possibility of their own regions, on the base to create grayscale images . In contrast, less well known that digital elevation models (DEM: Digital Elevation Model) for almost every place on earth for free on the Internet are available, which - let in 16-bit grayscale images and therefore also transform into accurately scaled SC4 regions - with a little practice . How this works is shown in the following step by step tutorial. CONTENTS first Introduction and fundamentals second DEM data and how do you get them third Digression: 8-bit and 16 bit grayscale images than fourth Projection and scaling 5th From each, on 16-bit PNG 6th Import into SC4 and post ATTENTION: The following programs are needed to understand how the tutorial can: GDAL - Geospatial Data Abstraction Library (link for download for Windows (about 4MB): [url]http://download.osgeo.org/gdal/win32[/url] in32exe160.zip ... ) 3DEM - Visualizatin software (download link is in the text just below the map display), a simple program for image editing, for example, IrfanView SC4Mapper also useful but are not essential SC4Terraformer a fast Internet connection, basic knowledge of Windows shell and a bit of mathematical basic understanding of toja Modified (16/11/2009 at 16:53 clock) toja is offline Reply With Quote Old 03.11.2009, 19:40 # 2 toja Members SimForum BAT Team Join Date: Oct 2008 Introduction and basics before each new SimCity 4 game presents itself first of all, the question of the right region. Certainly plays in selecting the aesthetics a major role in a diverse region with a beautiful terrain mod can only be a delight in itself. However, the significance of a region far beyond its aesthetic quality also, because by the nature of a region is the infrastructure of a city influenced significantly - at least if you put little on some real close to value and not stretch all the 100m bridge over a river or a mountain like wants to make holes like Swiss cheese with tunnels. Apart from such general considerations, of course, the size of a region of importance, that you should before writing a (accurately scaled) region of the corresponding proportions make SC4 thoughts. Thus, for example, the game comes with the region of San Francisco has about the estimated size of your thumb around large urban 4x4 cards. If you were to bring the region corresponding to the actual proportions in the game, you get to about 12x12 large maps, instead of 16 makes great after Adam Riese 144 city maps [!] - There are computers and players to do a lot. But how big are they now actually different city maps? Now, each field in SC4 has an edge length of 16m x 16m. Since the small card 64 x 64 squares, the middle card 128 x 128 fields and the large map of 256 x 256 has fields, the result is: small for the card: 1024m x 1024m, average for the card: 2048m x 2048m and great for the . card: 4096m x 4096m Armed with this information you can now - depending on the size you imagine about - via Google Maps or similar start looking for a suitable region. In this region, the future need not necessarily be square: I, for example, once a map of Turin and its surroundings made ​​the 28km x 16km in size and about 28 large city with maps is somewhat playable. edited by toja (03/11/2009 at 19: 48 Clock) toja is offline Reply With Quote Old 03.11.2009, 19:41 # 3 toja Members SimForum BAT team Joined: Oct 2008 DEM data and how do they get DEM data sets basically nothing more than special image files in raster graphics format. The only difference is that in a normal image file, each pixel is assigned a specific color value, which together form a complete picture. In a DEM data set instead each pixel is a number assigned to the corresponding height of the point indicating above sea level (hence must also be in a DEM record the information can be stored, which part of the earth's surface is actually shown). fact that DEM data sets are nothing more than raster graphics, share them with other images the property of a specific resolution to have - and the lower the resolution, the more blurred the picture. A DEM data, which for example an area of 1000m x 1000m and is 100 x 100 pixels in size, has a resolution of 10m, 10m in height as all information is available. A record that represents the same area, it however has a size of 1000 x 1000 pixels, would, however, a resolution of 1m. The first place to get digital elevation models (DEM) to obtain, is The National Map Seamless Server, a Web site that is the United States Geological Survey (USGS) provided. The USGS is there a number of geographical data for free download, including DEM data from all parts of the world (unfortunately) but in different resolutions. For the whole territory of the United States is DEM data available at a resolution of 1/3 arcsec, corresponding to a grid of approximately 10m x 10m, for the entire rest of the world is currently sold only one record with a resolution of 3 arc seconds, of a grid of approximately 90m x 90m equivalent. When you open the above site appears at first a welcome screen. There you click on "View & Download International Data" (the data for the U.S. there's there too) and it appears after a while the following interface: (! top center is the link attached to an extensive tutorial) First, you should right click Download ( A click) and put a checkmark in the appropriate data source: data from the U.S. 1/3'' NED, for the rest of the world SRTM Finished 3 arc sec then it zooms with the appropriate tools (B) to that region, the should be established beforehand, etc. on Google Maps has picked out. Finally, choose the download tool (C) and moves with the mouse a rectangle around the corresponding region, so you are sure to capture the region will also complete, whereupon the following popup window will appear: Warning: There you click zunächts on " Click Modify Data Request ", and selects the output format" GeoTiff ", then at the bottom of the" Save Changes & Return to summary ": It was only then click on Download and spoke the data on the hard disk until the data is there, it takes a ! little while after the download is complete, you can look at the result with the program 3DEM ever (to the zip file, unzip 3DEM open, as the data format GeoTiff and then select the appropriate file.): As can be seen easily, I have I selected the region around Geneva for the tutorial. TIP: For a few mountain regions outside the U.S. (eg the Alps) are available on this page and elevation models with a resolution of 1 arc second (~ 30m). The records in. Hgt format can be opened with 3DEM and save from there as a GeoTiff. edited by toja (04/11/2009 at 01:01 clock) toja is offline Reply With Quote Old 03.11.2009, 19:42 # 4 toja Members SimForum BAT Team Join Date: Oct 2008 Excursion: 8-bit and 16 bit grayscale images in comparison starts before the next chapters of the tricky part of the tutorial, it is my opinion very useful to deal even with the technical details behind it, why for 16-bit PNGs are now actually much better than 8-bit BMPs? First of all, both formats have in common is that they are raster graphics formats, ie each pixel is a certain (Color) value assigned. The main difference now is, how big is the interval in which these values ​​and just give it 8 or 16 bits information. To make matters a little pictorial, can be thought of as a bit of light bulb that either ( 1) or is off (0). If you imagine eight bulbs side by side (8bit) and runs through all possible on / off combinations of 00 million 00,000,001 00,000,010 00,000,011 ... 11,111,111 resulting 2 ^ 8 = 256 different combinations, that can be a pixel in an 8-bit BMP is one of 256 assign different numerical values, where 0 is black and 255 corresponds to the color white. At sixteen bulbs the whole thing looks quite different, run through here all the on / off combinations result is 2 ^ 16 = 65536 possible combinations, ie, 0 = black and 65535 = do! To understand what all this have to do with SC4-regions, it must lead you only to remember that even DEM data otherwise than raster graphics, and for that reason may be normal (8 bit) grayscale use BMPs and elevation models for SC4 - but they are quite inaccurate, since by default corresponds to each color value in the BMP file 3 meters in the game which (1) an ugly pixilated arises and (2) a terrain height can be realized by a maximum of 765m (for 255 x 3 = 765). Thanks to the SC4Mapper is fortunately possible to use 16-bit PNGs as the basis for the creation of regions, so that we do not have to grapple with such restrictions. On the contrary, there corresponds to each color value is 0.1 meters in height, so that a ground level can be realized by a maximum of 6553.5 m! edited by toja (04/11/2009 at 00:10 clock) toja is offline Reply With Quote Old 03.11.2009, 19 : 43 # 5 toja Members SimForum BAT team Joined: Oct 2008 projections and scaling STEP 1: PROJECTION If one wants to create an accurately scaled region for SC4, it is first faced with the problem that the earth is more or less spherical, while it is in the SC4 World is apparently an infinite plane is (or has happened to anyone ever played a region at the edges, it was not for SimNation?). The mathematical method by which you transfer the curved surface of the (three dimensional) world a (two dimensional) plane, called projection. So far, so good, but unfortunately the projection of the DEM data sets for our purposes, only limited use, because lengths - and latitude are treated here as a Cartesian coordinate system, resulting in the direction of the polar ice caps are more and more distorted, so that really point-like pole time was just an extension that corresponds to the equator, that is about 40,000 km. (source: Wikipedia) To this distortion in maps that represent only a small part of the earth's surface as small as possible, has have been done in many areas, with mapping by set the UTM coordinate system as the de facto standard - and in this very necessary to his THE . data to project this, open its record with 3DEM and click on the menu bar: Operation> Change Projection-> Convert to UTMProjection whereupon a small pop-up window will open where you can choose the shape of the earth ellipsoid. Data from the U.S. (1/3'' NED), one should choose NAD83, WGS84 for the rest of the world. then you should still make sure that any possible "holes" are filled in the DEM data, clicking in this the menu bar: operation>-F7 Patch Missing Data . and moves with the mouse a rectangle around the entire record, and press the RETURN key (so does my now from DEM) are thus modified, the cached data must now. In order to save some typing later on the Windows shell, you should store the record in the same folder where you unzipped the. Exe files of GDAL downloads. With me are the GDAL exe files in C:. \ Gdal \ bin \ (latest, now is the time to come and get to the GDAL package in one of the Windows shell to extract simple directory to be achieved). Therefore, I save my DEM data on File-> THE SaveGeoTiff, click OK and select a location is C: \ gdal \ bin \ and the file name Genf_UTM.tif STEP 2: Scaling As already stated above, THE share data with other image files, the property a specific resolution to have the unit but can vary depending on the projection of the data set. Besides the advantages already mentioned, the UTM projection has the advantage that the resolution is here measured in meters, while in the original data, the resolution specified in degrees internally. To that extent can the resolution of our modified data set is relatively easy to interpolate to the time required for SC4 resolution of 16m. To clarify: We have a DEM data set (in this case greatly increases ...) and the elevation model of SC4 region with a resolution of 16m . goal is the DEM data set (with a resolution of 10m/USA 90m/Rest or the world) to interpolate so that it matches the grid of 16m-SC4: For this, open a Windows command shell and change to the . cd to the directory in which lie the GDAL exe files as well as the modified DEM data arrived in the correct directory is then added the following: >>> gdalwarp tr-16 16-r bilinear quelldatei.tif zieldatei.tif with the flag-tr 16 16 (target resolution), one determines the resolution of the target file. By Fleg-r we define the bilinear interpolation method. The setting is achieved very useful results bilinear rule, you can certainly try, but sometimes other settings (more on that in the online documentation for GDAL) ... then just follow the name of the source and destination files, in my case genf_UTM. tif and genf_UTM_16.tif. Specifying a drive letter or path is not necessary because my DEM data are indeed in the same directory as the GDAL executable files. After pressing the RETURN key to the whole thing looks to me like this: Among other things, to read that my target file 4192x4416 pixels is impressive is grown! All the careful reader can already do the appropriate calculation, which corresponds to the surface - it looks like I should cut my region yet a little bit before I make my mind my GeoTiff into a 16bit PNG convert ... toja edited by (06.11.2009 at 17:05 clock) toja is offline Reply With Quote Old 03.11.2009, 19:44 # 6 toja Members SimForum BAT team Joined: Oct 2008 From each, on 16-bit PNG The first hurdle is done already: The GDAL folder GeoTiff is now a UTM projection with a resolution of 16m. Before the DEM data, however, can be transformed into a 16-bit PNG, the data must first be cut to a size compatible SC4, which is admittedly not entirely arbitrary. The smallest region that can be created for SC4 has the size of a small city map, all other region sizes are therefore derived from this surface. As already mentioned, there is a small city map of 64 x 64 squares. Furthermore, it can be seen in the fourth and fifth picture of the last section, that these fields between the bases of the elevation model are stretched. Therefore you need for a region of 64x64 fields and an elevation model with 65 x 65 bases. Granted, that sounds a bit complicated, so I've attached a small file, from which all kinds of region sizes to be including 32km x 32km in miles-intervals (or more precisely 1024m) and the corresponding size read the elevation model in pixels (do not worry I have not been written by hand ...) To cut to the modified level model now needs to be back working with GDAL, but the program requires the information which part of the DEMs should actually be cut. To obtain this information, we created the best at first a picture of the DEM data in JPEG format: After you have modified the DEM data (genf_UTM_16.tif) opened with 3DEM, click on Operation-> F6 Resize Overhead View whereupon a small window opens with a slider that has to be positioned so that at Map Scale the value of 1.00 appears, then click OK. The elevation model will now appear at full size in the output window and can be on File-> Save map image as normal image file. The size should be selected for JPEG, the location this time is no matter, you should just find it ... then you open that file with the image editing program of his choice, I use IrfanView below. With the selection tool to create a rectangle that represents the approximate size of the future region (see attached list, the size of the pixels to define exactly is not always possible, but not absolutely necessary). This is how it look for me: The information that we have to feed GDAL us IrfanView supplies in the taskbar at the top of the screen: the two numbers after "Selection" are the XY coordinates of the upper left corner of the marquee, followed by the proper size of the selection. In my case, I'm lying with two pixels just next to the desired size of 1537 x 1537, that is my area about 24 x 24 km will be large and include 36 large maps. So then, a Windows shell open in the list of GDAL . exe files, change the structure of the required command looks like this: >>> gdal_translate srcwin-X-Offset Y-Offset X Size Y Size quelldatei.tif zieldatei.tif With the flag-srcwin is obviously the location and size the desired section, set in my example, I type so: >>> gdal_translate-srcwin 1182 1505 1537 1537 genf_UTM_16.tif genf_UTM_final.tif After pressing RETURN key, it looks hopefully something like this: Hallelujah, the elevation model is now finally with the right projection, resolution and size before and is ready to turn into a 16bit PNG! . The only thing to note now is the correct conversion of elevation data values ​​in PNG But it brings to the command gdalinfo first find out what amount is on the lowest or highest point of the record: >>> gdalinfo-mm genf_UTM_final.tif The lowest point (that's me in the surface of Lake Geneva) lies at 360.51 m, the highest at 1474.41 m. It should be noted now that the sea is not in SC4 at 0m, but at 250m, ie also in PNG should be the lowest point at 250m. This, however, the elevation data to distort the Z-axis does not must be the difference in height of 110.51 meters (360.51 m - 110.51 m = 250) are also deducted from the highest point so that at 1363.9 m (1474.41 m - 110.51 m = 1363.9 m coming). With these data we can now make to the creation of 16-bit PNGs. What is needed is to re gdal_translate the command with the following structure: >>> gdal_translate-ot UInt16-of PNG-scale QuellMin QUELLMAX ZielMin ZielMax Quelldatei.tif Zieldatei.png The flag-ot UInt16 provides an output to 16 bits, with the flag - of PNG to provide course for the PNG format. exciting it gets the flag-scale, because here one must consider that the range of values ​​allowed for a 16-bit PNG 0-65535, so you have to multiply the values ​​obtained with 10! My command looks like so: >>> gdal_translate-ot UInt16-of PNG-Scale 360.51 1474 .41 13 639 2500 genf_UTM_final.tif genf_UTM_final.png Et voila, there goes accurately scaled 16-bit PNG! Attached Files File Type: pdf RegionSize.pdf ( 48.3 KB, 23 views) Last edited by toja (07.11.2009 at 01:35 clock) toja is offline Reply With Quote Old 03.11.2009, 19:45 # 7 toja Members SimForum BAT Team Join Date: Oct 2008 import into SC4 and post-processing compared with the creation of a digital elevation model in the 16-bit PNG format to import into SC4 using the SC4Mappers is simple: After opening the program, click on Create Region, in the opening pop-up window, choose 16-bit png as format, after which opens another pop-up window where you must specify its PNG file as source file. If all went well, should be in the fields Specify size automatically adjusted to the size of the region have. Now you have two options: By default, the SC4Mapper config.bmp one consisting exclusively of small maps, but alternatively it is also possible by selecting the appropriate option to specify a custom config.bmp. After the SC4Mapper PNG has loaded it takes only one click on the Save region and an appropriate name for the new region! In the upper left corner of the region can be seen how the region is at the first opening with the automatically generated summaries of SC4Mapper. But do not worry, after the city maps have been opened and saved shows, the region with the familiar terrain. Finally, a few technical notes: One of the biggest problems of the DEM data is probably that more of the surface waters or sea ​​surface are included as data, ie there is no information about how it actually looks beneath the surface. The result is that you must dig waters, as in my case, Lake Geneva, with the help of the God-mode Werzeuge SC4Terraformer or by hand. This is tedious and time consuming (especially if the card contains a river), but can be avoided, unfortunately not ... Another problem that must be located in the DEM data is not necessarily all the height information above sea level (think of only the Netherlands), so that at best we can potentially detect a coastline, but behind much of the region are under water. Here, too, manual labor is in demand! Finally, it should be noted that not a region in SC4 can be arbitrarily high. By default, the maximum terrain height is set to 2500m, with the different terrain mods, this value varies, however. In regions that have very large differences in height, this can lead to problems such as Wilfried Webber has demonstrated quite clearly below ... Remedy in such cases, the High Altitude patch. If by my side, but now create a lot of fun areas! - toja which is the United States Geological Survey (USGS) provided. The USGS is there a number of geographical data for free download, including DEM data from all parts of the world (unfortunately) but in different resolutions. For the whole territory of the United States is DEM data available at a resolution of 1/3 arcsec, corresponding to a grid of approximately 10m x 10m, for the entire rest of the world is currently sold only one record with a resolution of 3 arc seconds, of a grid of approximately 90m x 90m equivalent. When you open the above site appears at first a welcome screen. There you click on "View & Download International Data" (the data for the U.S. there's there too) and it appears after a while the following interface: (! top center is the link attached to an extensive tutorial) First, you should right click Download ( A click) and put a checkmark in the appropriate data source: data from the U.S. 1/3'' NED, for the rest of the world SRTM Finished 3 arc sec then it zooms with the appropriate tools (B) to that region, the should be established beforehand, etc. on Google Maps has picked out. Finally, choose the download tool (C) and moves with the mouse a rectangle around the corresponding region, so you are sure to capture the region will also complete, whereupon the following popup window will appear: Warning: There you click zunächts on " Click Modify Data Request ", and selects the output format" GeoTiff ", then at the bottom of the" Save Changes & Return to summary ": It was only then click on Download and spoke the data on the hard disk until the data is there, it takes a ! little while after the download is complete, you can look at the result with the program 3DEM ever (to the zip file, unzip 3DEM open, as the data format GeoTiff and then select the appropriate file.): As can be seen easily, I have I selected the region around Geneva for the tutorial. TIP: For a few mountain regions outside the U.S. (eg the Alps) are available on this page and elevation models with a resolution of 1 arc second (~ 30m). The records in. Hgt format can be opened with 3DEM and save from there as a GeoTiff. edited by toja (04/11/2009 at 01:01 clock) toja is offline Reply With Quote Old 03.11.2009, 19:42 # 4 toja Members SimForum BAT Team Join Date: Oct 2008 Excursion: 8-bit and 16 bit grayscale images in comparison starts before the next chapters of the tricky part of the tutorial, it is my opinion very useful to deal even with the technical details behind it, why for 16-bit PNGs are now actually much better than 8-bit BMPs? First of all, both formats have in common is that they are raster graphics formats, ie each pixel is a certain (Color) value assigned. The main difference now is, how big is the interval in which these values ​​and just give it 8 or 16 bits information. To make matters a little pictorial, can be thought of as a bit of light bulb that either ( 1) or is off (0). If you imagine eight bulbs side by side (8bit) and runs through all possible on / off combinations of 00 million 00,000,001 00,000,010 00,000,011 ... 11,111,111 resulting 2 ^ 8 = 256 different combinations, that can be a pixel in an 8-bit BMP is one of 256 assign different numerical values, where 0 is black and 255 corresponds to the color white. At sixteen bulbs the whole thing looks quite different, run through here all the on / off combinations result is 2 ^ 16 = 65536 possible combinations, ie, 0 = black and 65535 = do! To understand what all this have to do with SC4-regions, it must lead you only to remember that even DEM data otherwise than raster graphics, and for that reason may be normal (8 bit) grayscale use BMPs and elevation models for SC4 - but they are quite inaccurate, since by default corresponds to each color value in the BMP file 3 meters in the game which (1) an ugly pixilated arises and (2) a terrain height can be realized by a maximum of 765m (for 255 x 3 = 765). Thanks to the SC4Mapper is fortunately possible to use 16-bit PNGs as the basis for the creation of regions, so that we do not have to grapple with such restrictions. On the contrary, there corresponds to each color value is 0.1 meters in height, so that a ground level can be realized by a maximum of 6553.5 m! edited by toja (04/11/2009 at 00:10 clock) toja is offline Reply With Quote Old 03.11.2009, 19 : 43 # 5 toja Members SimForum BAT team Joined: Oct 2008 projections and scaling STEP 1: PROJECTION If one wants to create an accurately scaled region for SC4, it is first faced with the problem that the earth is more or less spherical, while it is in the SC4 World is apparently an infinite plane is (or has happened to anyone ever played a region at the edges, it was not for SimNation?). The mathematical method by which you transfer the curved surface of the (three dimensional) world a (two dimensional) plane, called projection. So far, so good, but unfortunately the projection of the DEM data sets for our purposes, only limited use, because lengths - and latitude are treated here as a Cartesian coordinate system, resulting in the direction of the polar ice caps are more and more distorted, so that really point-like pole time was just an extension that corresponds to the equator, that is about 40,000 km. (source: Wikipedia) To this distortion in maps that represent only a small part of the earth's surface as small as possible, has have been done in many areas, with mapping by set the UTM coordinate system as the de facto standard - and in this very necessary to his THE . data to project this, open its record with 3DEM and click on the menu bar: Operation> Change Projection-> Convert to UTMProjection whereupon a small pop-up window will open where you can choose the shape of the earth ellipsoid. Data from the U.S. (1/3'' NED), one should choose NAD83, WGS84 for the rest of the world. then you should still make sure that any possible "holes" are filled in the DEM data, clicking in this the menu bar: operation>-F7 Patch Missing Data . and moves with the mouse a rectangle around the entire record, and press the RETURN key (so does my now from DEM) are thus modified, the cached data must now. In order to save some typing later on the Windows shell, you should store the record in the same folder where you unzipped the. Exe files of GDAL downloads. With me are the GDAL exe files in C:. \ Gdal \ bin \ (latest, now is the time to come and get to the GDAL package in one of the Windows shell to extract simple directory to be achieved). Therefore, I save my DEM data on File-> THE SaveGeoTiff, click OK and select a location is C: \ gdal \ bin \ and the file name Genf_UTM.tif STEP 2: Scaling As already stated above, THE share data with other image files, the property a specific resolution to have the unit but can vary depending on the projection of the data set. Besides the advantages already mentioned, the UTM projection has the advantage that the resolution is here measured in meters, while in the original data, the resolution specified in degrees internally. To that extent can the resolution of our modified data set is relatively easy to interpolate to the time required for SC4 resolution of 16m. To clarify: We have a DEM data set (in this case greatly increases ...) and the elevation model of SC4 region with a resolution of 16m . goal is the DEM data set (with a resolution of 10m/USA 90m/Rest or the world) to interpolate so that it matches the grid of 16m-SC4: For this, open a Windows command shell and change to the . cd to the directory in which lie the GDAL exe files as well as the modified DEM data arrived in the correct directory is then added the following: >>> gdalwarp tr-16 16-r bilinear quelldatei.tif zieldatei.tif with the flag-tr 16 16 (target resolution), one determines the resolution of the target file. By Fleg-r we define the bilinear interpolation method. The setting is achieved very useful results bilinear rule, you can certainly try, but sometimes other settings (more on that in the online documentation for GDAL) ... then just follow the name of the source and destination files, in my case genf_UTM. tif and genf_UTM_16.tif. Specifying a drive letter or path is not necessary because my DEM data are indeed in the same directory as the GDAL executable files. After pressing the RETURN key to the whole thing looks to me like this: Among other things, to read that my target file 4192x4416 pixels is impressive is grown! All the careful reader can already do the appropriate calculation, which corresponds to the surface - it looks like I should cut my region yet a little bit before I make my mind my GeoTiff into a 16bit PNG convert ... toja edited by (06.11.2009 at 17:05 clock) toja is offline Reply With Quote Old 03.11.2009, 19:44 # 6 toja Members SimForum BAT team Joined: Oct 2008 From each, on 16-bit PNG The first hurdle is done already: The GDAL folder GeoTiff is now a UTM projection with a resolution of 16m. Before the DEM data, however, can be transformed into a 16-bit PNG, the data must first be cut to a size compatible SC4, which is admittedly not entirely arbitrary. The smallest region that can be created for SC4 has the size of a small city map, all other region sizes are therefore derived from this surface. As already mentioned, there is a small city map of 64 x 64 squares. Furthermore, it can be seen in the fourth and fifth picture of the last section, that these fields between the bases of the elevation model are stretched. Therefore you need for a region of 64x64 fields and an elevation model with 65 x 65 bases. Granted, that sounds a bit complicated, so I've attached a small file, from which all kinds of region sizes to be including 32km x 32km in miles-intervals (or more precisely 1024m) and the corresponding size read the elevation model in pixels (do not worry I have not been written by hand ...) To cut to the modified level model now needs to be back working with GDAL, but the program requires the information which part of the DEMs should actually be cut. To obtain this information, we created the best at first a picture of the DEM data in JPEG format: After you have modified the DEM data (genf_UTM_16.tif) opened with 3DEM, click on Operation-> F6 Resize Overhead View whereupon a small window opens with a slider that has to be positioned so that at Map Scale the value of 1.00 appears, then click OK. The elevation model will now appear at full size in the output window and can be on File-> Save map image as normal image file. The size should be selected for JPEG, the location this time is no matter, you should just find it ... then you open that file with the image editing program of his choice, I use IrfanView below. With the selection tool to create a rectangle that represents the approximate size of the future region (see attached list, the size of the pixels to define exactly is not always possible, but not absolutely necessary). This is how it look for me: The information that we have to feed GDAL us IrfanView supplies in the taskbar at the top of the screen: the two numbers after "Selection" are the XY coordinates of the upper left corner of the marquee, followed by the proper size of the selection. In my case, I'm lying with two pixels just next to the desired size of 1537 x 1537, that is my area about 24 x 24 km will be large and include 36 large maps. So then, a Windows shell open in the list of GDAL . exe files, change the structure of the required command looks like this: >>> gdal_translate srcwin-X-Offset Y-Offset X Size Y Size quelldatei.tif zieldatei.tif With the flag-srcwin is obviously the location and size the desired section, set in my example, I type so: >>> gdal_translate-srcwin 1182 1505 1537 1537 genf_UTM_16.tif genf_UTM_final.tif After pressing RETURN key, it looks hopefully something like this: Hallelujah, the elevation model is now finally with the right projection, resolution and size before and is ready to turn into a 16bit PNG! . The only thing to note now is the correct conversion of elevation data values ​​in PNG But it brings to the command gdalinfo first find out what amount is on the lowest or highest point of the record: >>> gdalinfo-mm genf_UTM_final.tif The lowest point (that's me in the surface of Lake Geneva) lies at 360.51 m, the highest at 1474.41 m. It should be noted now that the sea is not in SC4 at 0m, but at 250m, ie also in PNG should be the lowest point at 250m. This, however, the elevation data to distort the Z-axis does not must be the difference in height of 110.51 meters (360.51 m - 110.51 m = 250) are also deducted from the highest point so that at 1363.9 m (1474.41 m - 110.51 m = 1363.9 m coming). With these data we can now make to the creation of 16-bit PNGs. What is needed is to re gdal_translate the command with the following structure: >>> gdal_translate-ot UInt16-of PNG-scale QuellMin QUELLMAX ZielMin ZielMax Quelldatei.tif Zieldatei.png The flag-ot UInt16 provides an output to 16 bits, with the flag - of PNG to provide course for the PNG format. exciting it gets the flag-scale, because here one must consider that the range of values ​​allowed for a 16-bit PNG 0-65535, so you have to multiply the values ​​obtained with 10! My command looks like so: >>> gdal_translate-ot UInt16-of PNG-Scale 360.51 1474 .41 13 639 2500 genf_UTM_final.tif genf_UTM_final.png Et voila, there goes accurately scaled 16-bit PNG! Attached Files File Type: pdf RegionSize.pdf ( 48.3 KB, 23 views) Last edited by toja (07.11.2009 at 01:35 clock) toja is offline Reply With Quote Old 03.11.2009, 19:45 # 7 toja Members SimForum BAT Team Join Date: Oct 2008 import into SC4 and post-processing compared with the creation of a digital elevation model in the 16-bit PNG format to import into SC4 using the SC4Mappers is simple: After opening the program, click on Create Region, in the opening pop-up window, choose 16-bit png as format, after which opens another pop-up window where you must specify its PNG file as source file. If all went well, should be in the fields Specify size automatically adjusted to the size of the region have. Now you have two options: By default, the SC4Mapper config.bmp one consisting exclusively of small maps, but alternatively it is also possible by selecting the appropriate option to specify a custom config.bmp. After the SC4Mapper PNG has loaded it takes only one click on the Save region and an appropriate name for the new region! In the upper left corner of the region can be seen how the region is at the first opening with the automatically generated summaries of SC4Mapper. But do not worry, after the city maps have been opened and saved shows, the region with the familiar terrain. Finally, a few technical notes: One of the biggest problems of the DEM data is probably that more of the surface waters or sea ​​surface are included as data, ie there is no information about how it actually looks beneath the surface. The result is that you must dig waters, as in my case, Lake Geneva, with the help of the God-mode Werzeuge SC4Terraformer or by hand. This is tedious and time consuming (especially if the card contains a river), but can be avoided, unfortunately not ... Another problem that must be located in the DEM data is not necessarily all the height information above sea level (think of only the Netherlands), so that at best we can potentially detect a coastline, but behind much of the region are under water. Here, too, manual labor is in demand! Finally, it should be noted that not a region in SC4 can be arbitrarily high. By default, the maximum terrain height is set to 2500m, with the different terrain mods, this value varies, however. In regions that have very large differences in height, this can lead to problems such as Wilfried Webber has demonstrated quite clearly below ... Remedy in such cases, the High Altitude patch. If by my side, but now create a lot of fun areas! - toja which is the United States Geological Survey (USGS) provided. The USGS is there a number of geographical data for free download, including DEM data from all parts of the world (unfortunately) but in different resolutions. For the whole territory of the United States is DEM data available at a resolution of 1/3 arcsec, corresponding to a grid of approximately 10m x 10m, for the entire rest of the world is currently sold only one record with a resolution of 3 arc seconds, of a grid of approximately 90m x 90m equivalent. When you open the above site appears at first a welcome screen. There you click on "View & Download International Data" (the data for the U.S. there's there too) and it appears after a while the following interface: (! top center is the link attached to an extensive tutorial) First, you should right click Download ( A click) and put a checkmark in the appropriate data source: data from the U.S. 1/3'' NED, for the rest of the world SRTM Finished 3 arc sec then it zooms with the appropriate tools (B) to that region, the should be established beforehand, etc. on Google Maps has picked out. Finally, choose the download tool (C) and moves with the mouse a rectangle around the corresponding region, so you are sure to capture the region will also complete, whereupon the following popup window will appear: Warning: There you click zunächts on " Click Modify Data Request ", and selects the output format" GeoTiff ", then at the bottom of the" Save Changes & Return to summary ": It was only then click on Download and spoke the data on the hard disk until the data is there, it takes a ! little while after the download is complete, you can look at the result with the program 3DEM ever (to the zip file, unzip 3DEM open, as the data format GeoTiff and then select the appropriate file.): As can be seen easily, I have I selected the region around Geneva for the tutorial. TIP: For a few mountain regions outside the U.S. (eg the Alps) are available on this page and elevation models with a resolution of 1 arc second (~ 30m). The records in. Hgt format can be opened with 3DEM and save from there as a GeoTiff. edited by toja (04/11/2009 at 01:01 clock) toja is offline Reply With Quote Old 03.11.2009, 19:42 # 4 toja Members SimForum BAT Team Join Date: Oct 2008 Excursion: 8-bit and 16 bit grayscale images in comparison starts before the next chapters of the tricky part of the tutorial, it is my opinion very useful to deal even with the technical details behind it, why for 16-bit PNGs are now actually much better than 8-bit BMPs? First of all, both formats have in common is that they are raster graphics formats, ie each pixel is a certain (Color) value assigned. The main difference now is, how big is the interval in which these values ​​and just give it 8 or 16 bits information. To make matters a little pictorial, can be thought of as a bit of light bulb that either ( 1) or is off (0). If you imagine eight bulbs side by side (8bit) and runs through all possible on / off combinations of 00 million 00,000,001 00,000,010 00,000,011 ... 11,111,111 resulting 2 ^ 8 = 256 different combinations, that can be a pixel in an 8-bit BMP is one of 256 assign different numerical values, where 0 is black and 255 corresponds to the color white. At sixteen bulbs the whole thing looks quite different, run through here all the on / off combinations result is 2 ^ 16 = 65536 possible combinations, ie, 0 = black and 65535 = do! To understand what all this have to do with SC4-regions, it must lead you only to remember that even DEM data otherwise than raster graphics, and for that reason may be normal (8 bit) grayscale use BMPs and elevation models for SC4 - but they are quite inaccurate, since by default corresponds to each color value in the BMP file 3 meters in the game which (1) an ugly pixilated arises and (2) a terrain height can be realized by a maximum of 765m (for 255 x 3 = 765). Thanks to the SC4Mapper is fortunately possible to use 16-bit PNGs as the basis for the creation of regions, so that we do not have to grapple with such restrictions. On the contrary, there corresponds to each color value is 0.1 meters in height, so that a ground level can be realized by a maximum of 6553.5 m! edited by toja (04/11/2009 at 00:10 clock) toja is offline Reply With Quote Old 03.11.2009, 19 : 43 # 5 toja Members SimForum BAT team Joined: Oct 2008 projections and scaling STEP 1: PROJECTION If one wants to create an accurately scaled region for SC4, it is first faced with the problem that the earth is more or less spherical, while it is in the SC4 World is apparently an infinite plane is (or has happened to anyone ever played a region at the edges, it was not for SimNation?). The mathematical method by which you transfer the curved surface of the (three dimensional) world a (two dimensional) plane, called projection. So far, so good, but unfortunately the projection of the DEM data sets for our purposes, only limited use, because lengths - and latitude are treated here as a Cartesian coordinate system, resulting in the direction of the polar ice caps are more and more distorted, so that really point-like pole time was just an extension that corresponds to the equator, that is about 40,000 km. (source: Wikipedia) To this distortion in maps that represent only a small part of the earth's surface as small as possible, has have been done in many areas, with mapping by set the UTM coordinate system as the de facto standard - and in this very necessary to his THE . data to project this, open its record with 3DEM and click on the menu bar: Operation> Change Projection-> Convert to UTMProjection whereupon a small pop-up window will open where you can choose the shape of the earth ellipsoid. Data from the U.S. (1/3'' NED), one should choose NAD83, WGS84 for the rest of the world. then you should still make sure that any possible "holes" are filled in the DEM data, clicking in this the menu bar: operation>-F7 Patch Missing Data . and moves with the mouse a rectangle around the entire record, and press the RETURN key (so does my now from DEM) are thus modified, the cached data must now. In order to save some typing later on the Windows shell, you should store the record in the same folder where you unzipped the. Exe files of GDAL downloads. With me are the GDAL exe files in C:. \ Gdal \ bin \ (latest, now is the time to come and get to the GDAL package in one of the Windows shell to extract simple directory to be achieved). Therefore, I save my DEM data on File-> THE SaveGeoTiff, click OK and select a location is C: \ gdal \ bin \ and the file name Genf_UTM.tif STEP 2: Scaling As already stated above, THE share data with other image files, the property a specific resolution to have the unit but can vary depending on the projection of the data set. Besides the advantages already mentioned, the UTM projection has the advantage that the resolution is here measured in meters, while in the original data, the resolution specified in degrees internally. To that extent can the resolution of our modified data set is relatively easy to interpolate to the time required for SC4 resolution of 16m. To clarify: We have a DEM data set (in this case greatly increases ...) and the elevation model of SC4 region with a resolution of 16m . goal is the DEM data set (with a resolution of 10m/USA 90m/Rest or the world) to interpolate so that it matches the grid of 16m-SC4: For this, open a Windows command shell and change to the . cd to the directory in which lie the GDAL exe files as well as the modified DEM data arrived in the correct directory is then added the following: >>> gdalwarp tr-16 16-r bilinear quelldatei.tif zieldatei.tif with the flag-tr 16 16 (target resolution), one determines the resolution of the target file. By Fleg-r we define the bilinear interpolation method. The setting is achieved very useful results bilinear rule, you can certainly try, but sometimes other settings (more on that in the online documentation for GDAL) ... then just follow the name of the source and destination files, in my case genf_UTM. tif and genf_UTM_16.tif. Specifying a drive letter or path is not necessary because my DEM data are indeed in the same directory as the GDAL executable files. After pressing the RETURN key to the whole thing looks to me like this: Among other things, to read that my target file 4192x4416 pixels is impressive is grown! All the careful reader can already do the appropriate calculation, which corresponds to the surface - it looks like I should cut my region yet a little bit before I make my mind my GeoTiff into a 16bit PNG convert ... toja edited by (06.11.2009 at 17:05 clock) toja is offline Reply With Quote Old 03.11.2009, 19:44 # 6 toja Members SimForum BAT team Joined: Oct 2008 From each, on 16-bit PNG The first hurdle is done already: The GDAL folder GeoTiff is now a UTM projection with a resolution of 16m. Before the DEM data, however, can be transformed into a 16-bit PNG, the data must first be cut to a size compatible SC4, which is admittedly not entirely arbitrary. The smallest region that can be created for SC4 has the size of a small city map, all other region sizes are therefore derived from this surface. As already mentioned, there is a small city map of 64 x 64 squares. Furthermore, it can be seen in the fourth and fifth picture of the last section, that these fields between the bases of the elevation model are stretched. Therefore you need for a region of 64x64 fields and an elevation model with 65 x 65 bases. Granted, that sounds a bit complicated, so I've attached a small file, from which all kinds of region sizes to be including 32km x 32km in miles-intervals (or more precisely 1024m) and the corresponding size read the elevation model in pixels (do not worry I have not been written by hand ...) To cut to the modified level model now needs to be back working with GDAL, but the program requires the information which part of the DEMs should actually be cut. To obtain this information, we created the best at first a picture of the DEM data in JPEG format: After you have modified the DEM data (genf_UTM_16.tif) opened with 3DEM, click on Operation-> F6 Resize Overhead View whereupon a small window opens with a slider that has to be positioned so that at Map Scale the value of 1.00 appears, then click OK. The elevation model will now appear at full size in the output window and can be on File-> Save map image as normal image file. The size should be selected for JPEG, the location this time is no matter, you should just find it ... then you open that file with the image editing program of his choice, I use IrfanView below. With the selection tool to create a rectangle that represents the approximate size of the future region (see attached list, the size of the pixels to define exactly is not always possible, but not absolutely necessary). This is how it look for me: The information that we have to feed GDAL us IrfanView supplies in the taskbar at the top of the screen: the two numbers after "Selection" are the XY coordinates of the upper left corner of the marquee, followed by the proper size of the selection. In my case, I'm lying with two pixels just next to the desired size of 1537 x 1537, that is my area about 24 x 24 km will be large and include 36 large maps. So then, a Windows shell open in the list of GDAL . exe files, change the structure of the required command looks like this: >>> gdal_translate srcwin-X-Offset Y-Offset X Size Y Size quelldatei.tif zieldatei.tif With the flag-srcwin is obviously the location and size the desired section, set in my example, I type so: >>> gdal_translate-srcwin 1182 1505 1537 1537 genf_UTM_16.tif genf_UTM_final.tif After pressing RETURN key, it looks hopefully something like this: Hallelujah, the elevation model is now finally with the right projection, resolution and size before and is ready to turn into a 16bit PNG! . The only thing to note now is the correct conversion of elevation data values ​​in PNG But it brings to the command gdalinfo first find out what amount is on the lowest or highest point of the record: >>> gdalinfo-mm genf_UTM_final.tif The lowest point (that's me in the surface of Lake Geneva) lies at 360.51 m, the highest at 1474.41 m. It should be noted now that the sea is not in SC4 at 0m, but at 250m, ie also in PNG should be the lowest point at 250m. This, however, the elevation data to distort the Z-axis does not must be the difference in height of 110.51 meters (360.51 m - 110.51 m = 250) are also deducted from the highest point so that at 1363.9 m (1474.41 m - 110.51 m = 1363.9 m coming). With these data we can now make to the creation of 16-bit PNGs. What is needed is to re gdal_translate the command with the following structure: >>> gdal_translate-ot UInt16-of PNG-scale QuellMin QUELLMAX ZielMin ZielMax Quelldatei.tif Zieldatei.png The flag-ot UInt16 provides an output to 16 bits, with the flag - of PNG to provide course for the PNG format. exciting it gets the flag-scale, because here one must consider that the range of values ​​allowed for a 16-bit PNG 0-65535, so you have to multiply the values ​​obtained with 10! My command looks like so: >>> gdal_translate-ot UInt16-of PNG-Scale 360.51 1474 .41 13 639 2500 genf_UTM_final.tif genf_UTM_final.png Et voila, there goes accurately scaled 16-bit PNG! Attached Files File Type: pdf RegionSize.pdf ( 48.3 KB, 23 views) Last edited by toja (07.11.2009 at 01:35 clock) toja is offline Reply With Quote Old 03.11.2009, 19:45 # 7 toja Members SimForum BAT Team Join Date: Oct 2008 import into SC4 and post-processing compared with the creation of a digital elevation model in the 16-bit PNG format to import into SC4 using the SC4Mappers is simple: After opening the program, click on Create Region, in the opening pop-up window, choose 16-bit png as format, after which opens another pop-up window where you must specify its PNG file as source file. If all went well, should be in the fields Specify size automatically adjusted to the size of the region have. Now you have two options: By default, the SC4Mapper config.bmp one consisting exclusively of small maps, but alternatively it is also possible by selecting the appropriate option to specify a custom config.bmp. After the SC4Mapper PNG has loaded it takes only one click on the Save region and an appropriate name for the new region! In the upper left corner of the region can be seen how the region is at the first opening with the automatically generated summaries of SC4Mapper. But do not worry, after the city maps have been opened and saved shows, the region with the familiar terrain. Finally, a few technical notes: One of the biggest problems of the DEM data is probably that more of the surface waters or sea ​​surface are included as data, ie there is no information about how it actually looks beneath the surface. The result is that you must dig waters, as in my case, Lake Geneva, with the help of the God-mode Werzeuge SC4Terraformer or by hand. This is tedious and time consuming (especially if the card contains a river), but can be avoided, unfortunately not ... Another problem that must be located in the DEM data is not necessarily all the height information above sea level (think of only the Netherlands), so that at best we can potentially detect a coastline, but behind much of the region are under water. Here, too, manual labor is in demand! Finally, it should be noted that not a region in SC4 can be arbitrarily high. By default, the maximum terrain height is set to 2500m, with the different terrain mods, this value varies, however. In regions that have very large differences in height, this can lead to problems such as Wilfried Webber has demonstrated quite clearly below ... Remedy in such cases, the High Altitude patch. If by my side, but now create a lot of fun areas! - toja Therefore you need for a region of 64x64 fields and an elevation model with 65 x 65 bases. Granted, that sounds a bit complicated, so I've attached a small file, from which all kinds of region sizes to be including 32km x 32km in miles-intervals (or more precisely 1024m) and the corresponding size read the elevation model in pixels (do not worry I have not been written by hand ...) To cut to the modified level model now needs to be back working with GDAL, but the program requires the information which part of the DEMs should actually be cut. To obtain this information, we created the best at first a picture of the DEM data in JPEG format: After you have modified the DEM data (genf_UTM_16.tif) opened with 3DEM, click on Operation-> F6 Resize Overhead View whereupon a small window opens with a slider that has to be positioned so that at Map Scale the value of 1.00 appears, then click OK. The elevation model will now appear at full size in the output window and can be on File-> Save map image as normal image file. The size should be selected for JPEG, the location this time is no matter, you should just find it ... then you open that file with the image editing program of his choice, I use IrfanView below. With the selection tool to create a rectangle that represents the approximate size of the future region (see attached list, the size of the pixels to define exactly is not always possible, but not absolutely necessary). This is how it look for me: The information that we have to feed GDAL us IrfanView supplies in the taskbar at the top of the screen: the two numbers after "Selection" are the XY coordinates of the upper left corner of the marquee, followed by the proper size of the selection. In my case, I'm lying with two pixels just next to the desired size of 1537 x 1537, that is my area about 24 x 24 km will be large and include 36 large maps. So then, a Windows shell open in the list of GDAL . exe files, change the structure of the required command looks like this: >>> gdal_translate srcwin-X-Offset Y-Offset X Size Y Size quelldatei.tif zieldatei.tif With the flag-srcwin is obviously the location and size the desired section, set in my example, I type so: >>> gdal_translate-srcwin 1182 1505 1537 1537 genf_UTM_16.tif genf_UTM_final.tif After pressing RETURN key, it looks hopefully something like this: Hallelujah, the elevation model is now finally with the right projection, resolution and size before and is ready to turn into a 16bit PNG! . The only thing to note now is the correct conversion of elevation data values ​​in PNG But it brings to the command gdalinfo first find out what amount is on the lowest or highest point of the record: >>> gdalinfo-mm genf_UTM_final.tif The lowest point (that's me in the surface of Lake Geneva) lies at 360.51 m, the highest at 1474.41 m. It should be noted now that the sea is not in SC4 at 0m, but at 250m, ie also in PNG should be the lowest point at 250m. This, however, the elevation data to distort the Z-axis does not must be the difference in height of 110.51 meters (360.51 m - 110.51 m = 250) are also deducted from the highest point so that at 1363.9 m (1474.41 m - 110.51 m = 1363.9 m coming). With these data we can now make to the creation of 16-bit PNGs. What is needed is to re gdal_translate the command with the following structure: >>> gdal_translate-ot UInt16-of PNG-scale QuellMin QUELLMAX ZielMin ZielMax Quelldatei.tif Zieldatei.png The flag-ot UInt16 provides an output to 16 bits, with the flag - of PNG to provide course for the PNG format. exciting it gets the flag-scale, because here one must consider that the range of values ​​allowed for a 16-bit PNG 0-65535, so you have to multiply the values ​​obtained with 10! My command looks like so: >>> gdal_translate-ot UInt16-of PNG-Scale 360.51 1474 .41 13 639 2500 genf_UTM_final.tif genf_UTM_final.png Et voila, there goes accurately scaled 16-bit PNG! Attached Files File Type: pdf RegionSize.pdf ( 48.3 KB, 23 views) Last edited by toja (07.11.2009 at 01:35 clock) toja is offline Reply With Quote Old 03.11.2009, 19:45 # 7 toja Members SimForum BAT Team Join Date: Oct 2008 import into SC4 and post-processing compared with the creation of a digital elevation model in the 16-bit PNG format to import into SC4 using the SC4Mappers is simple: After opening the program, click on Create Region, in the opening pop-up window, choose 16-bit png as format, after which opens another pop-up window where you must specify its PNG file as source file. If all went well, should be in the fields Specify size automatically adjusted to the size of the region have. Now you have two options: By default, the SC4Mapper config.bmp one consisting exclusively of small maps, but alternatively it is also possible by selecting the appropriate option to specify a custom config.bmp. After the SC4Mapper PNG has loaded it takes only one click on the Save region and an appropriate name for the new region! In the upper left corner of the region can be seen how the region is at the first opening with the automatically generated summaries of SC4Mapper. But do not worry, after the city maps have been opened and saved shows, the region with the familiar terrain. Finally, a few technical notes: One of the biggest problems of the DEM data is probably that more of the surface waters or sea ​​surface are included as data, ie there is no information about how it actually looks beneath the surface. The result is that you must dig waters, as in my case, Lake Geneva, with the help of the God-mode Werzeuge SC4Terraformer or by hand. This is tedious and time consuming (especially if the card contains a river), but can be avoided, unfortunately not ... Another problem that must be located in the DEM data is not necessarily all the height information above sea level (think of only the Netherlands), so that at best we can potentially detect a coastline, but behind much of the region are under water. Here, too, manual labor is in demand! Finally, it should be noted that not a region in SC4 can be arbitrarily high. By default, the maximum terrain height is set to 2500m, with the different terrain mods, this value varies, however. In regions that have very large differences in height, this can lead to problems such as Wilfried Webber has demonstrated quite clearly below ... Remedy in such cases, the High Altitude patch. If by my side, but now create a lot of fun areas! - toja Therefore you need for a region of 64x64 fields and an elevation model with 65 x 65 bases. Granted, that sounds a bit complicated, so I've attached a small file, from which all kinds of region sizes to be including 32km x 32km in miles-intervals (or more precisely 1024m) and the corresponding size read the elevation model in pixels (do not worry I have not been written by hand ...) To cut to the modified level model now needs to be back working with GDAL, but the program requires the information which part of the DEMs should actually be cut. To obtain this information, we created the best at first a picture of the DEM data in JPEG format: After you have modified the DEM data (genf_UTM_16.tif) opened with 3DEM, click on Operation-> F6 Resize Overhead View whereupon a small window opens with a slider that has to be positioned so that at Map Scale the value of 1.00 appears, then click OK. The elevation model will now appear at full size in the output window and can be on File-> Save map image as normal image file. The size should be selected for JPEG, the location this time is no matter, you should just find it ... then you open that file with the image editing program of his choice, I use IrfanView below. With the selection tool to create a rectangle that represents the approximate size of the future region (see attached list, the size of the pixels to define exactly is not always possible, but not absolutely necessary). This is how it look for me: The information that we have to feed GDAL us IrfanView supplies in the taskbar at the top of the screen: the two numbers after "Selection" are the XY coordinates of the upper left corner of the marquee, followed by the proper size of the selection. In my case, I'm lying with two pixels just next to the desired size of 1537 x 1537, that is my area about 24 x 24 km will be large and include 36 large maps. So then, a Windows shell open in the list of GDAL . exe files, change the structure of the required command looks like this: >>> gdal_translate srcwin-X-Offset Y-Offset X Size Y Size quelldatei.tif zieldatei.tif With the flag-srcwin is obviously the location and size the desired section, set in my example, I type so: >>> gdal_translate-srcwin 1182 1505 1537 1537 genf_UTM_16.tif genf_UTM_final.tif After pressing RETURN key, it looks hopefully something like this: Hallelujah, the elevation model is now finally with the right projection, resolution and size before and is ready to turn into a 16bit PNG! . The only thing to note now is the correct conversion of elevation data values ​​in PNG But it brings to the command gdalinfo first find out what amount is on the lowest or highest point of the record: >>> gdalinfo-mm genf_UTM_final.tif The lowest point (that's me in the surface of Lake Geneva) lies at 360.51 m, the highest at 1474.41 m. It should be noted now that the sea is not in SC4 at 0m, but at 250m, ie also in PNG should be the lowest point at 250m. This, however, the elevation data to distort the Z-axis does not must be the difference in height of 110.51 meters (360.51 m - 110.51 m = 250) are also deducted from the highest point so that at 1363.9 m (1474.41 m - 110.51 m = 1363.9 m coming). With these data we can now make to the creation of 16-bit PNGs. What is needed is to re gdal_translate the command with the following structure: >>> gdal_translate-ot UInt16-of PNG-scale QuellMin QUELLMAX ZielMin ZielMax Quelldatei.tif Zieldatei.png The flag-ot UInt16 provides an output to 16 bits, with the flag - of PNG to provide course for the PNG format. exciting it gets the flag-scale, because here one must consider that the range of values ​​allowed for a 16-bit PNG 0-65535, so you have to multiply the values ​​obtained with 10! My command looks like so: >>> gdal_translate-ot UInt16-of PNG-Scale 360.51 1474 .41 13 639 2500 genf_UTM_final.tif genf_UTM_final.png Et voila, there goes accurately scaled 16-bit PNG! Attached Files File Type: pdf RegionSize.pdf ( 48.3 KB, 23 views) Last edited by toja (07.11.2009 at 01:35 clock) toja is offline Reply With Quote Old 03.11.2009, 19:45 # 7 toja Members SimForum BAT Team Join Date: Oct 2008 import into SC4 and post-processing compared with the creation of a digital elevation model in the 16-bit PNG format to import into SC4 using the SC4Mappers is simple: After opening the program, click on Create Region, in the opening pop-up window, choose 16-bit png as format, after which opens another pop-up window where you must specify its PNG file as source file. If all went well, should be in the fields Specify size automatically adjusted to the size of the region have. Now you have two options: By default, the SC4Mapper config.bmp one consisting exclusively of small maps, but alternatively it is also possible by selecting the appropriate option to specify a custom config.bmp. After the SC4Mapper PNG has loaded it takes only one click on the Save region and an appropriate name for the new region! In the upper left corner of the region can be seen how the region is at the first opening with the automatically generated summaries of SC4Mapper. But do not worry, after the city maps have been opened and saved shows, the region with the familiar terrain. Finally, a few technical notes: One of the biggest problems of the DEM data is probably that more of the surface waters or sea ​​surface are included as data, ie there is no information about how it actually looks beneath the surface. The result is that you must dig waters, as in my case, Lake Geneva, with the help of the God-mode Werzeuge SC4Terraformer or by hand. This is tedious and time consuming (especially if the card contains a river), but can be avoided, unfortunately not ... Another problem that must be located in the DEM data is not necessarily all the height information above sea level (think of only the Netherlands), so that at best we can potentially detect a coastline, but behind much of the region are under water. Here, too, manual labor is in demand! Finally, it should be noted that not a region in SC4 can be arbitrarily high. By default, the maximum terrain height is set to 2500m, with the different terrain mods, this value varies, however. In regions that have very large differences in height, this can lead to problems such as Wilfried Webber has demonstrated quite clearly below ... Remedy in such cases, the High Altitude patch. If by my side, but now create a lot of fun areas! - toja
You know, the google translation isn't all that bad. Assuming you are a native english speaker, you shouldn't have a problem using it. You would just have to touch it up in a few places.
[QUOTE=Splash Attack;36105724]You know, the google translation isn't all that bad. Assuming you are a native english speaker, you shouldn't have a problem using it. You would just have to touch it up in a few places.[/QUOTE] I was trying google translate, it had started out decent but mid way it just didn't cut it, I could no longer even get the gist of what was being conveyed. It's a tutorial and there are parts where you [b]really[/b] need to know [b]exactly[/b] what he's saying.
Sorry, you need to Log In to post a reply to this thread.