Bagaimana menggabungkan peta format mapinfo dengan google maps

Posted: 29 April 2011 in Uncategorized

Beginilah caranya..  Ga pake basa basi ya.. langsung aja dah

1. Download ms4w versi windows disini  (saya pakai ms4w versi windows versi 5.6.6)

2. extract dan copy folder ms4w ke (misal) F:\ abis itu jangan lupa klik apache-install.bat di F:\ms4w untuk install apache ms4w

3. buat folder gmapserv di F:\ms4w\apache\htdocs\

4. buat file map dengan nama peta.map di F:\ms4w\apache\htdocs\gmapserv\

5. buka peta.map pake notepad trus isi ini

MAP

NAME JAKARTA
STATUS ON
SIZE 500 300
SYMBOLSET “F:/ms4w/Apache/htdocs/gmapserv/etc/symbols.sym”
EXTENT 106.60766 -6.32288 107.04327 -6.06377
#EXTENT 93.832022 -14.931460 141.320222 13.561460
IMAGETYPE PNG
UNITS DD
IMAGECOLOR 100 100 120
FONTSET “F:/ms4w/Apache/htdocs/gmapserv/etc/fonts.txt”

PROJECTION
“init=epsg:4326”
END

#
# Start of web interface definition
#
WEB
MINSCALE 100
MAXSCALE 6917011
#
# On Windows systems, /tmp and /tmp/ms_tmp/ should be created at the root
# of the drive where the .MAP file resides.
#
IMAGEPATH “/ms4w/tmp/ms_tmp/”
IMAGEURL “/ms_tmp/”
#  LOG “/tmp/gmap.log”
END

QUERYMAP
STYLE HILITE
COLOR 255 0 0
END

SCALEBAR
STATUS OFF
UNITS KILOMETERS
INTERVALS 5
POSITION LL
SIZE 400 5
STYLE 0
BACKGROUNDCOLOR 0 0 0
COLOR 255 255 255
OUTLINECOLOR 0 0 0
IMAGECOLOR 255 255 255
LABEL
TYPE BITMAP
POSITION UL
OFFSET 0 0
SIZE SMALL
BUFFER 0
MINDISTANCE -1
MINFEATURESIZE -1
COLOR 0 0 0
PARTIALS TRUE
FORCE FALSE
END
END

LAYER
NAME Jawa_Kabupaten
METADATA
“DESCRIPTION”   “Kabupaten Di Pulau Jawa”
“RESULT_FIELDS” “KABU_NAMA”
END
TYPE POLYGON
STATUS ON
LabelItem “KABU_NAMA”
CONNECTIONTYPE OGR
CONNECTION “F:/ms4w/Apache/htdocs/gmapserv/mapinfo/Kabupaten_D.TAB”
CLASS
NAME “KABUPATEN”
LABEL
COLOR 180 180 51
FONT pixel
TYPE truetype
SIZE 6
POSITION AUTO
PARTIALS FALSE
OUTLINECOLOR 0 0 0
BUFFER 30
END
#COLOR 100 255 0
COLOR 255 255 255
END
TEMPLATE “dummy”

#TOLERANCE UNITS

END # Layer

LAYER
NAME Jawa_Kecamatan
METADATA
“DESCRIPTION”   “Kecamatan”
“RESULT_FIELDS” “KECA_NAMA”
END
TYPE POLYGON
STATUS OFF
CONNECTIONTYPE OGR
CONNECTION “F:/ms4w/Apache/htdocs/gmapserv/mapinfo/Kecamatan_D.TAB”
LabelItem “KECA_NAMA”
CLASS
NAME “KECAMATAN”
LABEL
COLOR 200 255 51
FONT pixel
TYPE truetype
SIZE 6
POSITION AUTO
PARTIALS FALSE
OUTLINECOLOR 0 0 0
BUFFER 30
END
#COLOR 100 255 0
COLOR 255 255 255
#OUTLINECOLOR  255 255 255
END
TEMPLATE “dummy”
TRANSPARENCY 50
#TOLERANCE UNITS

END # Layer

LAYER
NAME Jawa_Desa
METADATA
“DESCRIPTION”   “Kelurahan Di Pulau Jawa”
“RESULT_FIELDS” “DESA_NAMA”
END
TYPE POLYGON
STATUS OFF
LabelItem “DESA_NAMA”
CONNECTIONTYPE OGR
CONNECTION “F:/ms4w/Apache/htdocs/gmapserv/mapinfo/Kelurahan_Desa_D.TAB”
CLASS
NAME “KELURAHAN”
LABEL
COLOR 0 0 0
FONT pixel
TYPE truetype
SIZE 7
POSITION AUTO
PARTIALS FALSE
OUTLINECOLOR 255 255 255
BUFFER 30
END
COLOR 255 255 255
#OUTLINECOLOR  255 255 255
END
TEMPLATE “dummy”
#TOLERANCE UNITS

END # Layer

LAYER
NAME Jawa_Jalan
METADATA
“DESCRIPTION” “Jalan Utama Pulau Jawa”
END
TYPE LINE
STATUS OFF
CONNECTIONTYPE OGR
CONNECTION “F:/ms4w/Apache/htdocs/gmapserv/mapinfo/Jalan_D.TAB”
CLASS
NAME “jalan”
STYLE
COLOR 0 0 0
MAXSIZE 10 # default 50
SYMBOL ‘solidLine’
SIZE 2
END #style
COLOR 230 230 230
OUTLINECOLOR 0 0 0
END
END # layer

LAYER
NAME Jawa_Jakarta_DetailJalan
METADATA
“DESCRIPTION” “Jalan DKI Jakarta”
END
TYPE LINE
STATUS OFF
CONNECTIONTYPE OGR
CONNECTION “F:/ms4w/Apache/htdocs/gmapserv/mapinfo/DKI-JL.TAB”
CLASS
NAME “jalan”
COLOR 200 200 200
OUTLINECOLOR 255 255 255
END
END # layer

LAYER
NAME Jawa_Jakarta_NamaJalan
METADATA
“DESCRIPTION”   “Nama Jalan DKI”
“RESULT_FIELDS” “NAMA_JALAN”
END
TYPE LINE
STATUS OFF
CONNECTIONTYPE OGR
CONNECTION “F:/ms4w/Apache/htdocs/gmapserv/mapinfo/jakarta_jalan.TAB”
LabelItem “NAMA_JALAN”
CLASS
NAME “NAMA JALAN”
STYLE
COLOR 0 0 0
MAXSIZE 10 # default 50
SYMBOL ‘solidLine’
SIZE 2
END #style
LABEL
ANGLE 0
COLOR 0 0 0
FONT pixel
TYPE truetype
SIZE 6
POSITION AUTO
PARTIALS FALSE
BUFFER 30
OUTLINECOLOR 255 255 255
END
COLOR 255 0 0
OUTLINECOLOR 255 0 0
END
TOLERANCE 5
END # Layer

LAYER
NAME RAILWAY
METADATA
“DESCRIPTION” “railway”
END
TYPE LINE
STATUS OFF
DATA “F:/ms4w/Apache/htdocs/gmapserv/mapinfo/railway.shp”
CLASS
NAME “jalan”
STYLE
COLOR 0 0 0
MAXSIZE 10 # default 50
SYMBOL ‘dashedLine’
SIZE 2
END #style
LABEL
ANGLE 0
COLOR 0 0 0
FONT pixel
TYPE truetype
SIZE 6
POSITION AUTO
PARTIALS FALSE
BUFFER 30
OUTLINECOLOR 255 255 255
END
COLOR 0 0 0
OUTLINECOLOR 0 0 0
END
END # layer

LAYER
NAME “TERMINAL”
TYPE POINT
STATUS OFF
LabelItem “OBJECTNAME”
DATA “F:/ms4w/Apache/htdocs/gmapserv/mapinfo/terminal.shp”
CLASS
NAME “0”
STYLE
COLOR 255 0 0 # red
MAXSIZE 300 # default 50
SYMBOL ‘icon/terminal.gif’
SIZE 15
END #style
LABEL
COLOR 255 100 100
FONT pixel
TYPE truetype
SIZE 7
POSITION AUTO
PARTIALS FALSE
OUTLINECOLOR 255 255 255
BUFFER 10
END
COLOR 255 255 255
#OUTLINECOLOR  255 255 255
END
TEMPLATE “dummy”
END #layer

LAYER
NAME “TRAIN”
TYPE POINT
STATUS OFF
LabelItem “OBJECTNAME”
DATA “F:/ms4w/Apache/htdocs/gmapserv/mapinfo/railway_station.shp”
CLASS
NAME “0”
STYLE
COLOR 255 0 0 # red
MAXSIZE 300 # default 50
SYMBOL ‘icon/icon_train.gif’
SIZE 20
END #style
LABEL
COLOR 255 100 100
FONT pixel
TYPE truetype
SIZE 7
POSITION AUTO
PARTIALS FALSE
OUTLINECOLOR 255 255 255
BUFFER 10
END
COLOR 255 255 255
#OUTLINECOLOR  255 255 255
END
TEMPLATE “dummy”
END #layer

LAYER
NAME “SHOP”
TYPE POINT
STATUS OFF
LabelItem “Label”
CONNECTIONTYPE OGR
CONNECTION “F:/ms4w/Apache/htdocs/gmapserv/mapinfo/shopping.TAB”
#DATA “SELECT * FROM shopping WHERE Label LIKE ‘%MADA%'”
CLASS
NAME “TOKO”
STYLE
COLOR 255 0 0 # red
MAXSIZE 300 # default 50
SYMBOL ‘icon/shop.gif’
SIZE 20
END #style
LABEL
COLOR 0 100 255
FONT pixel
TYPE truetype
SIZE 7
POSITION AUTO
PARTIALS FALSE
OUTLINECOLOR 255 255 255
BUFFER 10
END
COLOR 255 255 255
#OUTLINECOLOR  255 255 255
END
TEMPLATE “dummy”
END #layer

LAYER
NAME “POSPOL”
TYPE POINT
STATUS OFF
LabelItem “NAMA”
CONNECTIONTYPE OGR
CONNECTION “F:/ms4w/Apache/htdocs/gmapserv/mapinfo/pospol.TAB”
#DATA “SELECT * FROM pospol WHERE jenis = ‘T'”
CLASS
NAME “TOKO”
STYLE
COLOR 255 0 0 # red
MAXSIZE 300 # default 50
SYMBOL ‘icon/sedang.GIF’
SIZE 7
END #style
LABEL
COLOR 255 0 0
FONT pixel
TYPE truetype
SIZE 7
POSITION AUTO
PARTIALS FALSE
OUTLINECOLOR 255 255 255
BUFFER 10
END
COLOR 255 255 255
#OUTLINECOLOR  255 255 255
END
TEMPLATE “dummy”
END #layer

END # Map File

6. simpan trus tutup file peta.map

6. buat folder etc di F:\ms4w\apache\htdocs\gmapserv

7. buat file baru di dalam folder etc tadi dengan nama symbols.sym trus isi dengan ini

SYMBOLSET

Symbol
Name ‘tent’
Type VECTOR
Filled TRUE
Points
0 1
.5 0
1 1
.75 1
.5 .5
.25 1
0 1
END
END

Symbol
Name ‘star’
Type VECTOR
Filled TRUE
Points
0 .375
.35 .375
.5 0
.65 .375
1 .375
.75 .625
.875 1
.5 .75
.125 1
.25 .625
END
END

Symbol
Name ‘triangle’
Type VECTOR
Filled TRUE
Points
0 1
.5 0
1 1
0 1
END
END

Symbol
Name ‘square’
Type VECTOR
Filled TRUE
Points
0 1
0 0
1 0
1 1
0 1
END
END

Symbol
Name ‘plus’
Type VECTOR
Points
.5 0
.5 1
-99 -99
0 .5
1 .5
END
END

Symbol
Name ‘cross’
Type VECTOR
Points
0 0
1 1
-99 -99
0 1
1 0
END
END

Symbol
Name ‘circle’
Type ELLIPSE
Filled TRUE
Points
1 1
END
END

Symbol
Type VECTOR
TRANSPARENT 0
Points
0 1
1 1
END
END

Symbol
Type VECTOR
TRANSPARENT 0
Points
1 0
1 1
END
END

Symbol
Type VECTOR
TRANSPARENT 0
Points
0 0
1 1
END
END

Symbol
Type VECTOR
TRANSPARENT 0
Points
0 1
1 0
END
END

Symbol
Type VECTOR
Points
0 1
1 0
-99 -99
0 0
1 1
END
END

Symbol
Type ELLIPSE
Filled TRUE
Points
1 1
END
END

SYMBOL
NAME ‘solidLine’
TYPE ELLIPSE
POINTS 1 1 END
FILLED true
END

SYMBOL
NAME ‘dashedLine’
TYPE ELLIPSE
POINTS 1 1 END
FILLED true
STYLE 5 5 5 5 END
END

8. buat folder icon di F:\ms4w\apache\htdocs\gmapserv\ trus isi dengan icon yang bakal dipakai untuk nandain titik (lihat di peta.map)

9. buat folder mapinfo di F:\ms4w\apache\htdocs\gmapserv\ trus isi dengan file2 peta yang akan dipakai

10. buat file index.php di F:\ms4w\apache\htdocs\gmapserv\ trus isi dengan ini

<!DOCTYPE html
PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN”
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”&gt;
<html xmlns=”http://www.w3.org/1999/xhtml”&gt;
<head>
<meta http-equiv=”content-type” content=”text/html; charset=utf-8″/>
<title>Google/MapServer Tile Example</title>
<script src=”http://maps.google.com/maps?file=api&v=2&key=%5BYOUR KEY HERE]”
type=”text/javascript”></script>
<script type=”text/javascript”>

function load() {
if (GBrowserIsCompatible()) {
/*
var urlTemplate = ‘http://localhost/cgi-bin/mapserv?&#8217;;
urlTemplate += ‘map=/var/map.map&’;
urlTemplate += ‘layers=layer1 layer2&’;
urlTemplate += ‘mode=tile&’;
urlTemplate += ’tilemode=gmap&’;
urlTemplate += ’tile={X}+{Y}+{Z}’;
*/
var urlTemplate = ‘http://localhost/cgi-bin/mapserv.exe?map=F:/ms4w/Apache/htdocs/gmapserv/peta.map&layers=Jawa_Kabupaten&mode=tile&tilemode=gmap&tile={X}+{Y}+{Z}’;
var myLayer = new GTileLayer(null,0,18,{
tileUrlTemplate:urlTemplate,
isPng:true,
opacity:0.3 });
var map = new GMap2(document.getElementById(“map”));
map.addControl(new GLargeMapControl());
map.addControl(new GMapTypeControl());
map.setCenter(new GLatLng(-6.32288, 106.60766), 15);
map.addOverlay(new GTileLayerOverlay(myLayer));
}
}

</script>
</head>
<body onload=”load()” onunload=”GUnload()”>
<div id=”map” style=”width: 500px; height: 500px”></div>
</body>
</html>

11. buka browser trus arahkan ke http://localhost/gmapserv/

Komentar
  1. naga mengatakan:

    saya sangat berterima kasih atas ilmunya,,dan ini sangat erguna untuk skripsi saya..

  2. Bambang Ismanto mengatakan:

    Sudah saya coba dan berhasil

  3. Mas/Pak, saya mau nanya ni. apakah map hasil gabungannya bisa di buka di perangkat mobile (J2ME) ?

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s