[mapserver-users] OGRVRT Data Sources and SQL server

Chris Jackson webturtles at gmail.com
Wed May 30 05:42:27 PDT 2012


Hi Robert and Jeff

I tried those steps (think FID is optional) and no further - more blank
outputs using shp2img (ms bebugging at 5 - no errors at all, happily finds
layer and draws it - apparently! - should rename my layer to snowflakes or
white cats....).  Have run shp2img debugging - nothing obvious, but
couldn't print out output (can send screenshot if anyone interested).  Not
sure how to retrieve the sql query sent (Jeff?).

I have grabbed the output from ogrinfo (see below - no extents...does that
mean something) - seems to be working ok to the untrained eye!  Mapfile
below too (NB. have tried with and without projections at map and layer
level), I am baffled, will start to use a later version of ms4w and check
on another server too.

Cheers
Chris

ogrinfo output:

INFO: Open of `d:/xxx/xxx/omreg2.ovf'
      using driver `VRT' successful.

Layer name: omreg1
Geometry: Point
Feature Count: 5
Layer SRS WKT:
GEOGCS["WGS 84",
    DATUM["WGS_1984",
        SPHEROID["WGS 84",6378137,298.257223563,
            AUTHORITY["EPSG","7030"]],
        AUTHORITY["EPSG","6326"]],
    PRIMEM["Greenwich",0,
        AUTHORITY["EPSG","8901"]],
    UNIT["degree",0.01745329251994328,
        AUTHORITY["EPSG","9122"]],
    AUTHORITY["EPSG","4326"]]
SiteKeyID: Integer (10.0)
SiteID: Integer (10.0)
SiteType: String (255.0)
SiteName: String (255.0)
SiteLat: Real (0.0)
SiteLong: Real (0.0)
OGRFeature(omreg1):1
  SiteKeyID (Integer) = 2269
  SiteID (Integer) = 1
  SiteType (String) = Regulated tidal exchange
  SiteName (String) = Abbotts Hall (Stage 1)
  SiteLat (Real) = 0.84556009184722
  SiteLong (Real) = 51.7846475991705
  POINT (51.784647599170498 0.84556009184722)

My mapfile now is this:

MAP
UNITS meters
EXTENT -15 30 40 70
SIZE 600 500
SHAPEPATH "d:\xxx\xxx\"
SYMBOLSET "../common/symbols/symbols-pmapper.sym"
FONTSET "../common/fonts/msfontset.txt"
RESOLUTION 96
IMAGETYPE png
INTERLACE OFF
CONFIG "PROJ_LIB" "D:\xxx\proj\nad\"
CONFIG "GDAL_DATA" "D:\xxx\gdaldata\"
CONFIG "MS_ERRORFILE" "D:\xxxxx\tmp\ms_error.txt"
DEBUG 5
  PROJECTION
    #"init=epsg:4326"
    "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs  no_defs"
  END

#
# Image formates for GD
#
OUTPUTFORMAT
  NAME "png"
  DRIVER "GD/PNG"
  MIMETYPE "image/png"
  IMAGEMODE RGB
  FORMATOPTION  INTERLACE=OFF
  TRANSPARENT OFF
  EXTENSION "png"
END

OUTPUTFORMAT
  NAME "png8"
  DRIVER "GD/PNG"
  MIMETYPE "image/png"
  IMAGEMODE PC256
  FORMATOPTION  INTERLACE=OFF
  TRANSPARENT OFF
  EXTENSION "png"
END

OUTPUTFORMAT
  NAME "jpeg"
  DRIVER "GD/JPEG"
  MIMETYPE "image/jpeg"
  IMAGEMODE RGB
  FORMATOPTION "QUALITY=70"
  EXTENSION "jpg"
END


OUTPUTFORMAT
  NAME GTiff
  DRIVER "GDAL/GTiff"
  MIMETYPE "image/tiff"
  IMAGEMODE RGB
  FORMATOPTION "TFW=YES"
  #FORMATOPTION "COMPRESS=PACKBITS"
  EXTENSION "tif"
END

OUTPUTFORMAT
  NAME imagemap
  MIMETYPE "text/html"
  FORMATOPTION SKIPENDTAG=OFF
  DRIVER imagemap
END


  LAYER
    NAME "test"
    TYPE POINT
    CONNECTIONTYPE OGR
    CONNECTION "omreg2.ovf" # have also tried ./omreg2.ovf - both files in
same folder - no luck with either
    DATA "omreg1"
  PROJECTION
    #"init=epsg:4326"
    "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs  no_defs"
  END
    STATUS ON
    CLASS
      SYMBOL 1
      SIZE 6
      COLOR 255 0 0
      LABEL
    SIZE MEDIUM
    TYPE BITMAP
    COLOR 0 0 0
      END
    END
END

END  #Map

On 29 May 2012 21:54, Robert Sanson <Robert.Sanson at asurequality.com> wrote:

> Hi Chris
>
> You need to define the primary key in your .ovf file:
>
> <FID>farmgate_id</FID>
>
> I put the .ovf file in the same directory as my .map file, then Mapserver
> can find it:
>
> CONNECTION "./farmgates.ovf"
>
> All thebest,
>
> Robert
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20120530/286b59da/attachment.html>


More information about the mapserver-users mailing list