place a point in the map

N M mapserver at HOTMAIL.COM
Wed Jul 13 01:57:39 PDT 2005


Hi David,

I tested my application with an Access database.

It contains a table named taula
long   lat
15     28
25     50
28     75
60     100

I created a DSN link named mapa21mdb

My mapa21.ovf file is:

<OGRVRTDataSource>
        <OGRVRTLayer  name="mapa21">
        <SrcDataSource>ODBC:mapa21mdb</SrcDataSource>
        <SrcLayer>taula</SrcLayer>
        <GeometryField encoding="PointFromColumns" x="long" y="lat"/>
        <GeometryType>wkbPoint</GeometryType>
        </OGRVRTLayer>
</OGRVRTDataSource>



Then I tryed connection executing:  ogrinfo 
d:\webserver\mapserver2\mapa21.ovf -ro
and result was:

INFO: Open of `d:\webserver\mapserver2\mapa21.ovf'
using driver `VRT' successful.
1: mapa21 (Point)



Later I tried:   ogrinfo d:\webserver\mapserver2\mapa21.ovf mapa21 -ro
and result was:

INFO: Open of `d:\webserver\mapserver2\mapa21.ovf'
using driver `VRT' successful.

Layer name: mapa21
Geometry: Point
Feature Count: 4
Extent: (15.000000, 28.000000) - (60.000000, 100.000000)
Layer SRS WKT:
(unknown)
long: String (50.0)
lat: String (50.0)
OGRFeature(mapa21):0
  long (String) = 15
  lat (String) = 28
  POINT (15 28)

OGRFeature(mapa21):1
  long (String) = 25
  lat (String) = 50
  POINT (25 50)

OGRFeature(mapa21):2
  long (String) = 38
  lat (String) = 75
  POINT (38 75)

OGRFeature(mapa21):3
  long (String) = 60
  lat (String) = 100
  POINT (60 100)



Then I created my map:

MAP
  IMAGETYPE      PNG
  EXTENT   15.000000 28.000000 60.000000 100.000000
  SIZE           500 350
  #SHAPEPATH      "data"
  IMAGECOLOR     255 180 0

  # Start of LAYER DEFINITIONS ---------------------------------------------

  LAYER
    NAME "MyVirtualLayer"
    TYPE POINT
    CONNECTIONTYPE OGR
    CONNECTION "mapa21.ovf"
    DATA "taula" # the name of the OGRVrtLayer
    STATUS ON
    LABELITEM long #may need to use table.name or just name depending on 
your OVF file.
    PROJECTION
      "init=epsg:4326"
    END

    CLASS
      SYMBOL 1
      SIZE 6
      COLOR 255 0 0
      LABEL
	SIZE MEDIUM
	TYPE BITMAP
	COLOR 0 0 0
      END
    END
END

  # End of LAYER DEFINITIONS -------------------------------
END # end of map file


The only thing that appears in the screen is a yellow rectangle, nothing 
else. Could be the wrong extent values?

I thank you for your help.

Nuri

_________________________________________________________________
Moda para esta temporada. Ponte al día de todas las tendencias. 
http://www.msn.es/Mujer/moda/default.asp



More information about the MapServer-users mailing list