Agar label tidak terpotong, konfigurasi mapfile adalah sebagai berikut.
WEB
METADATA
"labelcache_map_edge_buffer" "-100"
END
END
CLASS
LABEL
PARTIALS FALSE
END
END
Hehe
2010/02/18
EPSG:4326
EPSG:4326 is a common coordinate reference system that refers to WGS84 as (latitude, longitude) pair coordinates in degrees with Greenwich as the central meridian.
Proyeksi Google Maps
Proyeksi Google Maps adalah sebagai berikut.
PROJECTION
"+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgri...@null +no_defs"
END
Hehe
PROJECTION
"+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgri...@null +no_defs"
END
Hehe
MS4W
MS4W berisi:
- Apache HTTP Server version 2.2.14
- PHP version 5.3.1
- MapServer CGI 5.6.1
- MapScript 5.6.1 (CSharp, Java, PHP, Python)
- Includes support for Oracle 11g, and SDE data (if you have associated client/dlls)
- MrSID support built-in
- GDAL/OGR 1.7.0 and Utilities
- MapServer Utilities
- PROJ Utilities
- Shapelib Utilities
- Shp2tile Utility
- Shpdiff Utility
- AVCE00 Utilities
- OGR/PHP Extension 1.0.0
- OWTChart 1.2.0
Hehe
- Apache HTTP Server version 2.2.14
- PHP version 5.3.1
- MapServer CGI 5.6.1
- MapScript 5.6.1 (CSharp, Java, PHP, Python)
- Includes support for Oracle 11g, and SDE data (if you have associated client/dlls)
- MrSID support built-in
- GDAL/OGR 1.7.0 and Utilities
- MapServer Utilities
- PROJ Utilities
- Shapelib Utilities
- Shp2tile Utility
- Shpdiff Utility
- AVCE00 Utilities
- OGR/PHP Extension 1.0.0
- OWTChart 1.2.0
Hehe
Tighten Control of Access to Mapfiles and Templates
MapServer versions 5.2.1 and older could potentially be used to access arbitrary files via the creation of mapfiles or templates in untrusted directories.
The new access control mechanisms will be implemented and released in MapServer 5.4.0, 5.2.2 and 4.10.4.
The following mechanisms will be put in place:
- Enforce the requirement for the MAP keyword at the beginning of mapfiles and for the SYMBOLSET keyword at the beginning of SYMBOLSETs.
- Require a Magic String at the beginning of all MapServer templates
- Use of environment variables to control and restrict access to mapfiles by the mapserv CGI: MS_MAP_PATTERN, MS_MAP_NO_PATH
Each of the points above are described in more details in the following sections.
The MAP and SYMBOLSET keywords used to be optional at the beginning of mapfiles and symbolsets respectively.
With this change, the MAP keyword will be required on the first line of mapfiles and the SYMBOLSET keyword required on the first line of symbolset files.
If the keyword is missing then the parser will reject the file.
With this change, the first line of a template must contain the “MapServer Template” magic string which can be surrounded by comment delimiters in the format of the template to facilitate template editing (see examples below). The first line of the template file will automatically be stripped from the template and will not be included in the MapServer output.
If the magic string is not found then the template will be rejected by MapServer.
The new access control mechanisms will be implemented and released in MapServer 5.4.0, 5.2.2 and 4.10.4.
Technical Solution
The following mechanisms will be put in place:
- Enforce the requirement for the MAP keyword at the beginning of mapfiles and for the SYMBOLSET keyword at the beginning of SYMBOLSETs.
- Require a Magic String at the beginning of all MapServer templates
- Use of environment variables to control and restrict access to mapfiles by the mapserv CGI: MS_MAP_PATTERN, MS_MAP_NO_PATH
Each of the points above are described in more details in the following sections.
Enforce the requirement for the MAP and SYMBOLSET keywords
The MAP and SYMBOLSET keywords used to be optional at the beginning of mapfiles and symbolsets respectively.
With this change, the MAP keyword will be required on the first line of mapfiles and the SYMBOLSET keyword required on the first line of symbolset files.
If the keyword is missing then the parser will reject the file.
Require a Magic String at the beginning of all MapServer templates
With this change, the first line of a template must contain the “MapServer Template” magic string which can be surrounded by comment delimiters in the format of the template to facilitate template editing (see examples below). The first line of the template file will automatically be stripped from the template and will not be included in the MapServer output.
If the magic string is not found then the template will be rejected by MapServer.
Tile Mode
Introduction
MapServer can feed tile-based map clients directly using the CGI “tile mode”. Tile-based map clients work by dividing the map of the world up into a discrete number of zoom levels, each partitioned into a number of identically sized “tiles”. Instead of accessing a map by requesting a bounding box, a tile client builds a map by accessing individual tiles.
Tile requests are handled by the ‘mapserv’ CGI program. In order to return tiles in the correct projection, MapServer must be built with the –use-proj option turned on. You can check if your version of ‘mapserv’ has projection support by running it with the ‘-v’ option and looking for ‘SUPPORTS=PROJ’.
MapServer requires that each LAYER in your map file have a valid PROJECTION block to support reprojection. Because the tile mode uses reprojection, you will have to ensure each LAYER has a valid PROJECTION block.
Configuration checklist:
- MapServer compiled with PROJ support
- Map file with a PROJECTION defined for every LAYER
Utilization
The MapServer tile support adds three new directives to the CGI interface:
- mode=tile tells the server to generate tiles based on the other tile mode parameters
- tilemode=gmap tells the server use the Google Maps tile scheme for the tiles
- tile=x+y+z tells the server what tile you want to retrieve, using the Google Maps tile addressing system
- tilemode=ve tells the server use the Virtual Earth tile naming scheme for the tiles
- tile=10231 tells the server what tile you want to retrieve, using the Virtual Earth tile addressing system
Skala Google Maps
Skala Google Maps per level adalah sebagai berikut.
z17 = 1:2250
z16 = 1:4500
z15 = 1:9000
z14 = 1:23000
z13 = 1:46000
z12 = 1:93000
z11 = 1:188000
z10 = 1:350000
z9 =1:725000
dst.
Hehe
z17 = 1:2250
z16 = 1:4500
z15 = 1:9000
z14 = 1:23000
z13 = 1:46000
z12 = 1:93000
z11 = 1:188000
z10 = 1:350000
z9 =1:725000
dst.
Hehe
How to Install GCC Compiler in Ubuntu
Install package called build-essential is the best way
build-essential contains a list of packages which are essential for building Ubuntu packages including gcc compiler, make and other required tools.
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install build-essential
gcc -v
make -v
build-essential contains a list of packages which are essential for building Ubuntu packages including gcc compiler, make and other required tools.
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install build-essential
gcc -v
make -v
How can I make my maps run faster?
There are a lot of different approaches to improving the performance of your maps, aside from the obvious and expensive step of buying faster hardware. Here are links to some individual howtos for various optimizations.
- Tuning your mapfile for performance
- Optimizing the performance of vector data sources
- Optimizing the performance of raster data sources
- Tileindexes for mosaicing and performance
- Tuning your mapfile for performance
- Optimizing the performance of vector data sources
- Optimizing the performance of raster data sources
- Tileindexes for mosaicing and performance
msLoadMap(): Failed to open map file
Error displayed when trying to display map image.
The message tells you that MapServer cannot find mapfile. Verify that you have specified the correct path to the mapfile. Linux/Unix users should make sure that the web user has access permissions to the mapfile path as well.
The message tells you that MapServer cannot find mapfile. Verify that you have specified the correct path to the mapfile. Linux/Unix users should make sure that the web user has access permissions to the mapfile path as well.
msSaveImageGD(): Unable to access file
Error displayed when attempting to display map image.
This error is displayed if MapServer cannot display the map image. There are several things to check:
- IMAGEPATH and IMAGEURL parameters in mapfile are valid
- In CGI mode, any IMAGEPATH and IMAGEURL variables set in the init pages are valid
- Linux/Unix users should verify that the web user has permissions to write to the IMAGEPATH
This error is displayed if MapServer cannot display the map image. There are several things to check:
- IMAGEPATH and IMAGEURL parameters in mapfile are valid
- In CGI mode, any IMAGEPATH and IMAGEURL variables set in the init pages are valid
- Linux/Unix users should verify that the web user has permissions to write to the IMAGEPATH
AGG Rendering Specifics
MapServer 5.0 released with a new rendering backend.
24 bit png (high quality, large file size):
OUTPUTFORMAT
NAME 'AGG'
DRIVER AGG/PNG
IMAGEMODE RGB
END
24 bit png, transparent background:
OUTPUTFORMAT
NAME 'AGGA'
DRIVER AGG/PNG
IMAGEMODE RGBA
END
24 bit jpeg (jpeg compression artifacts may appear, but smaller file size):
OUTPUTFORMAT
NAME 'AGG_JPEG'
DRIVER AGG/JPEG
IMAGEMODE RGB
END
png output, with number of colors reduced with quantization.
OUTPUTFORMAT
NAME 'AGG_Q'
DRIVER AGG/PNG
IMAGEMODE RGB
FORMATOPTION "QUANTIZE_FORCE=ON"
FORMATOPTION "QUANTIZE_DITHER=OFF"
FORMATOPTION "QUANTIZE_COLORS=256"
END
All rendering is now done antialiased by default. All ANTIALIAS keywords are now ignored, as well as TRANSPARENCY ALPHA. Pixmaps and fonts are now all drawn respecting the image’s internal alpha channel (unless a backgroundcolor is specified).
As with GD in ver. 4.10, using a SYMBOL of type ELLIPSE to draw thick lines isn’t mandatory anymore. To draw a thick line just use:
STYLE
WIDTH 5
COLOR 0 0 255
END
A line symbolizer has been added, that works with vector or pixmap symbols, to draw textured lines. This happens by default if a line’s style is given a symbol of type vector or pixmap. To enable “shield” symbolization, i.e. a marker placed only on some points of the line, you must add a GAP parameter to your symbol definition. This GAP value is scaled w.r.t the style’s SIZE parameter. Specify a positive gap value for symbols always facing north (optionally rotated by the ANGLE of the current style), or a negative value for symbols that should follow the line orientation
This happens by default if a line’s style is given a symbol of type vector or pixmap. To enable “shield” symbolization, i.e. a marker placed only on some points of the line, you must add a GAP parameter to your symbol definition. This GAP value is scaled w.r.t the style’s SIZE parameter - specify a positive gap value for symbols always facing north (optionally rotated by the ANGLE of the current style), or a negative value for symbols that should follow the line orientation
Pixmap and font symbols can now be rotated without loosing their transparency
For POLYGON layers with no specific SYMBOL, the WIDTH keyword specifies the width of the outline, if an OUTLINECOLOR was specified. This is a shorthand that avoids having to create multiple styles for basic rendering, and will provide a marginal performance gain. Note that in this case, the width of the outline is /not/ scale dependent.
When specifying a SYMBOL for a polygon shape, the GAP parameter of the symbol is used as a separation between each rendered symbol. This works for symbols of type vector, pixmap and ellipse. For example a symbol defined by
SYMBOL
NAME 'triangle'
TYPE VECTOR
FILLED TRUE
POINTS
0 1
.5 0
1 1
0 1
END
GAP 1
END
Setting the OutputFormat
24 bit png (high quality, large file size):
OUTPUTFORMAT
NAME 'AGG'
DRIVER AGG/PNG
IMAGEMODE RGB
END
24 bit png, transparent background:
OUTPUTFORMAT
NAME 'AGGA'
DRIVER AGG/PNG
IMAGEMODE RGBA
END
24 bit jpeg (jpeg compression artifacts may appear, but smaller file size):
OUTPUTFORMAT
NAME 'AGG_JPEG'
DRIVER AGG/JPEG
IMAGEMODE RGB
END
png output, with number of colors reduced with quantization.
OUTPUTFORMAT
NAME 'AGG_Q'
DRIVER AGG/PNG
IMAGEMODE RGB
FORMATOPTION "QUANTIZE_FORCE=ON"
FORMATOPTION "QUANTIZE_DITHER=OFF"
FORMATOPTION "QUANTIZE_COLORS=256"
END
New Features
All rendering is now done antialiased by default. All ANTIALIAS keywords are now ignored, as well as TRANSPARENCY ALPHA. Pixmaps and fonts are now all drawn respecting the image’s internal alpha channel (unless a backgroundcolor is specified).
As with GD in ver. 4.10, using a SYMBOL of type ELLIPSE to draw thick lines isn’t mandatory anymore. To draw a thick line just use:
STYLE
WIDTH 5
COLOR 0 0 255
END
A line symbolizer has been added, that works with vector or pixmap symbols, to draw textured lines. This happens by default if a line’s style is given a symbol of type vector or pixmap. To enable “shield” symbolization, i.e. a marker placed only on some points of the line, you must add a GAP parameter to your symbol definition. This GAP value is scaled w.r.t the style’s SIZE parameter. Specify a positive gap value for symbols always facing north (optionally rotated by the ANGLE of the current style), or a negative value for symbols that should follow the line orientation
This happens by default if a line’s style is given a symbol of type vector or pixmap. To enable “shield” symbolization, i.e. a marker placed only on some points of the line, you must add a GAP parameter to your symbol definition. This GAP value is scaled w.r.t the style’s SIZE parameter - specify a positive gap value for symbols always facing north (optionally rotated by the ANGLE of the current style), or a negative value for symbols that should follow the line orientation
Pixmap and font symbols can now be rotated without loosing their transparency
For POLYGON layers with no specific SYMBOL, the WIDTH keyword specifies the width of the outline, if an OUTLINECOLOR was specified. This is a shorthand that avoids having to create multiple styles for basic rendering, and will provide a marginal performance gain. Note that in this case, the width of the outline is /not/ scale dependent.
Modified Behavior
When specifying a SYMBOL for a polygon shape, the GAP parameter of the symbol is used as a separation between each rendered symbol. This works for symbols of type vector, pixmap and ellipse. For example a symbol defined by
SYMBOL
NAME 'triangle'
TYPE VECTOR
FILLED TRUE
POINTS
0 1
.5 0
1 1
0 1
END
GAP 1
END
GD Won't Complie Against libpng 1.4.0
From the libpng README.
"Removed the deprecated png_check_sig() function/macro."
The file ext/gd/libgd/gd_png.c currently uses this function and so will not compile against libpng 1.4.0. The libpng man page notes the following:
"The function png_check_sig(sig, num) was replaced with !png_sig_cmp(sig, 0, num). It has been deprecated since libpng-0.90."
Hehe
"Removed the deprecated png_check_sig() function/macro."
The file ext/gd/libgd/gd_png.c currently uses this function and so will not compile against libpng 1.4.0. The libpng man page notes the following:
"The function png_check_sig(sig, num) was replaced with !png_sig_cmp(sig, 0, num). It has been deprecated since libpng-0.90."
Hehe
Sekilas Tentang Library yang Dibutuhkan Oleh MapServer
1. GD
GD adalah library grafik. GD dependencies terdiri dari zlib, libpng, FreeType, dan libJPEG, yang memungkinkan GD memiliki kemampuan untuk mengkompres image, merender image PNG, menggunakan font TrueType, dan merender image JPEG.
2. FreeType
FreeType adalah sebuah font-rendering engine. Tidak digunakan langsung oleh MapServer tetapi digunakan GD untuk merender font.
3. libJPEG
Untuk merender image JPEG.
4. libpng
Untuk merender image PNG.
5. zlib
Untuk kompresi data.
6. GDAL
Library translator untuk data raster. Memiliki kemampuan untuk mengimport georeferenced raster image.
7. OGR
Menyediakan akses untuk membaca dan menulis berbagai macam format vektor.
8. Proj4
Library untuk proyeksi kartografi.
9. shapelib
Library untuk membuat dan manipulasi shapefile.
10.libcurl
Untuk menyediakan WMS support.
11.PDFLib
Membuat output PDF.
Hehe
GD adalah library grafik. GD dependencies terdiri dari zlib, libpng, FreeType, dan libJPEG, yang memungkinkan GD memiliki kemampuan untuk mengkompres image, merender image PNG, menggunakan font TrueType, dan merender image JPEG.
2. FreeType
FreeType adalah sebuah font-rendering engine. Tidak digunakan langsung oleh MapServer tetapi digunakan GD untuk merender font.
3. libJPEG
Untuk merender image JPEG.
4. libpng
Untuk merender image PNG.
5. zlib
Untuk kompresi data.
6. GDAL
Library translator untuk data raster. Memiliki kemampuan untuk mengimport georeferenced raster image.
7. OGR
Menyediakan akses untuk membaca dan menulis berbagai macam format vektor.
8. Proj4
Library untuk proyeksi kartografi.
9. shapelib
Library untuk membuat dan manipulasi shapefile.
10.libcurl
Untuk menyediakan WMS support.
11.PDFLib
Membuat output PDF.
Hehe
Subscribe to:
Posts (Atom)