New Spatialite format with Mapserver and GDAL/OGR 1.7.0

Sometime we find something such simple as stupide ... I think that Spatialite is one of that.  If you look for a GIS storage format AND tabular data, very simple, open, easy to use and manage with Mapserver, python or php, take a look to this solution. Note that with a single database file you can build, query and manage your data like MySql or Postgresql. For my test, I use the open data Natural Earth, and it work at my first try ..! :) Rock On!! My NaturalEarth.sqlite file can be dowload here. (Natural Earth. Free vector and raster map data @ naturalearthdata.com). I load it with the Spatiallite-gui tools and than visualize them with the Spatiallite-gis... It take's me 15 minutes... Including the download and install steps... To make my first WMS Spatialite data test, I build a mapfile for Mapserver with this cool free vector dataset of Natural Earth. I just have to replace the shapefiles connection string with a OGR connection type and specify the table name:         CONNECTIONTYPE OGR         CONNECTION "path_to_spatialite_file"         DATA "50m-geography-marine-polys" Also, note that you HAVE to use the latest GDAL/OGR(version 1.7.0). If you use MS4W, you can download the beta10 or later. My first impression is that is not as fast as shapefile format. I gona test for larger dataset later... But, according to OGR specification web page, this driver still don't take advantage of spatial index?. So it's not a negative tips of this format... My mapfile test is here: MAP     NAME "spatialite"     EXTENT -180 -90 180 90       SIZE 700 500     IMAGETYPE PNG     IMAGECOLOR 0 0 0       UNITS METERS     SYMBOLSET                   "/ms4w/msp/symbols/commun/symbols.map"     FONTSET                     "/ms4w/msp/fonts/commun/fonts.txt"     CONFIG MS_ERRORFILE         "/ms4w/tmp/mapserv.log"     WEB         QUERYFORMAT     "text/xml"         BROWSEFORMAT    "text/xml"         IMAGEPATH       "/srv/www/msp/services/tmp/"         IMAGEURL        "/ms_tmp/"             METADATA            "wms_title"                  "spatialite test"            "wms_name"                   "spatialite"            "wms_abstract"               ""            "wms_description"            ""            "wms_keywordlist"            "Spatialite test"            "wms_onlineresource"         "http://localhost/cgi-bin/mapserv.exe?map=C:/Travail/spatialite/spatialite.map"         END     END     PROJECTION         "init=epsg:4326"     END     LAYER         NAME "50m-admin-1-states-provinces-shp"         DATA "C:/Travail/spatialite/NaturalEarth/50m-admin-1-states-provinces-shp.shp"          TYPE polygon         PROJECTION             "init=epsg:4326"         END         METADATA             "wms_name"              "50m-admin-1-states-provinces-shp"             "wms_title"             "states-provinces shapefiles"             "wms_keywordlist"       ""             "wms_server_version"    "1.1.1"         END         CLASS             NAME "states-provinces"             STYLE                 COLOR 255 90 90             END         END     END         LAYER         NAME "50m-admin-0-countries"         CONNECTIONTYPE OGR         CONNECTION "C:/Travail/spatialite/NaturalEarth/NaturalEarth.sqlite"  # full path to SQLite db file         DATA "50m-admin-0-countries"         TYPE polygon         PROJECTION             "init=epsg:4326"         END         METADATA             "wms_name"              "50m-admin-0-countries"             "wms_title"             "50m-admin-0-countries"             "wms_keywordlist"       ""             "wms_server_version"    "1.1.1"             "wms_extent"            "-180 -90 180 90"         END         CLASS             NAME "states-provinces"             STYLE                 COLOR 255 190 190             END         END     END      LAYER         NAME "50m-geography-marine-polys"         CONNECTIONTYPE OGR         CONNECTION "C:/Travail/spatialite/NaturalEarth/NaturalEarth.sqlite"  # full path to SQLite db file         DATA "50m-geography-marine-polys"          TYPE polygon         PROJECTION             "init=epsg:4326"         END         METADATA             "wms_name"              "50m-geography-marine-polys"             "wms_title"             "50m-geography-marine-polys"             "wms_keywordlist"       ""             "wms_server_version"    "1.1.1"             "wms_extent"            "-180 -90 180 90"         END         CLASS             NAME "states-provinces"             STYLE                 COLOR 24 116 205             END         END     END  END 

How to have nice symbol pixmap with transparency in Mapserver

First, to have a nice symbol pixmap, you should reduce the size of the image the same size it should appear in the map. To do this, you must not resize the symbol in the class layer of your mapfile.  It may be necessary to resample your image. Use Gimp(a photoshop Open sources) for this. For transparency works well, use a gif format. If your symbol(image) does not use transparency, you can quickly create one with Microsoft Photo Editor.  You only need to identify the background color with Transparent Color function.  This little function allows you to quickly create a NoData Value for image. Then, you must know the index(NoData Value) of transparent color of your symbole. This is not the transparent RGB color. To do this, you can use the utility gdalinfo to get the transparent index color. In this example, we have NoData Value = 254. Finally, just have to put this value in the symbol pixmap of your mapfile: SYMBOL    NAME "nn"    TYPE PIXMAP    IMAGE "1nn.gif"    TRANSPARENT 254 END

GDAL/OGR 1.7.0 beta2 for testing

A new released of GDAL is now packaged for testing.   Major issue is:
* New GDAL drivers : BAG, EPSILON, Northwood/VerticalMapper, R, Rasterlite,
                     SAGA GIS Binary, SRP (USRP/ASRP), EarthWatch .TIL, WKT Raster
* GDAL PCIDSK driver using the nw PCIDSK SDK by default
* New OGR drivers : DXF, GeoRSS, GTM, PCIDSK and VFK
* New utility : gdaldem, gdalbuildvrt now compiled by default
* Add support for Python 3.X. Compatibility with Python 2.X preserved (#3265)
* Remove old-generation Python bindings.
* Significantly improved GDAL drivers: GeoRaster, GeoTIFF, HFA, JPEG2000 Jasper,
                                       JPEG2000 Kakadu, NITF
* Significantly improved OGR drivers: CSV, KML, SQLite (SpatiaLite support), VRT
The complet list of bug fix,  general change and notes are here: http://svn.osgeo.org/gdal/trunk/gdal/NEWS Feedback as tickets or otherwise is welcome on GDAL/OGR Tracker and Wiki web site.  Official released(1.7.0) is wish before the end of the month. Update january 20, 2010 First Release candidate 1.7.0 RC1 http://download.osgeo.org/gdal/gdal-1.7.0RC1.tar.gz http://download.osgeo.org/gdal/gdal170RC1.zip