[mapserver-users] Problem with polygons

Kamen Rider kamenriderichigo at gmail.com
Fri Apr 4 15:02:45 EDT 2008


Sorry, but I must insist. I hope someone could help me.

---------- Forwarded message ----------
From: Kamen Rider <kamenriderichigo at gmail.com>
Date: 26-mar-2008 9:51
Subject:
To: mapserver-users at lists.osgeo.org

Hello,
I need something specific: To draw polygons (parcels) over a SHP map, and
none of the examples I found on the web worked.
Also I have no problems displaying points and I'm using UTM coordinates.

This is what I did:

1.- Compiled MS on Linux (CentOS) and Install.
MapServer version 5.0.0 OUTPUT=GIF OUTPUT=PNG OUTPUT=WBMP OUTPUT=SVG
SUPPORTS=PROJ SUPPORTS=FREETYPE SUPPORTS=WMS_SERVER SUPPORTS=SOS_SERVER
INPUT=EPPL7 INPUT=OGR INPUT=GDAL INPUT=MYGIS INPUT=SHAPEFILE

2.- Installed MySql.

3.- Created a table on MySql to store polygons. Here is the description.
This table is called "prueba"
+----------+---------+------+-----+---------+-------+
| Field    | Type    | Null | Key | Default | Extra |
+----------+---------+------+-----+---------+-------+
| NUM      | int(11) | YES  |     | NULL    |       |
| ID       | int(11) | YES  |     | NULL    |       |
| poligono | text    | YES  |     | NULL    |       |
+----------+---------+------+-----+---------+-------+
This is what inserted on field poligono:
POLYGON((350000 6270000,350000 6275000,360000 6275000,360000 6270000,350000
6270000))
**
4.- Then created a OVF file, according to this example. (aqidata.ovf)
http://www.dottedeyes.com/web_mapping/blog/2008/02/06/how-to-display-polygons-from-non-spatial-databases/

This is my OVF file :

<OGRVRTDataSource>
    <OGRVRTLayer name="aqidata">

<SrcDataSource>MYSQL:test,user=root,password=xxxxx,host=localhost,port=3306,tables=prueba</SrcDataSource>
        <SrcSQL>select NUM, ID, poligono from prueba</SrcSQL>
        <FID>ID</FID>
        <GeometryType>wkbPolygon</GeometryType>
        <GeometryField encoding="WKT" field="poligono"/>
 </OGRVRTLayer>
</OGRVRTDataSource>
Using OGRINFO I Tested the connection, this is the result:

INFO: Open of `/var/www/cgi-bin/tests/aqidata.ovf'
      using driver `VRT' successful.

Layer name: aqidata
Geometry: Polygon
Feature Count: 1
Layer SRS WKT:
(unknown)
NUM: Integer (11.0)
ID: Integer (11.0)
poligono: Binary (0.0)
OGRFeature(aqidata):1
  NUM (Integer) = 1
  ID (Integer) = 1
  poligono (Binary) =
504F4C59474F4E282833353030303020363237303030302C333530303030203632373530...


5.- Then a created a MAP file:

MAP
  NAME "Testing"
  EXTENT -177773.12 6409691.13 525065 6511086
  #IMAGETYPE JPEG
  #IMAGETYPE PNG24
  IMAGETYPE PNG
  IMAGECOLOR 255 255 255
  STATUS ON
  SIZE 400 400
  FONTSET "fonts.txt"
  SYMBOLSET "symbols.txt"


  WEB
    METADATA
      "key1" "value1"
      "key2" "value2"
      "key3" "value3"
      "key4" "value4"
    END
  END


  PROJECTION
    "init=epsg:4326"
  END

 LAYER
    NAME "POLIGONO"
    DEBUG ON
    STATUS DEFAULT
    TYPE POLYGON
    PROJECTION
      "init=epsg:4326"
    END
    CONNECTIONTYPE OGR
    CONNECTION "aqidata.ovf"
 DATA "aqidata"
    CLASS
       NAME "MyClass"
           STYLE
               COLOR 0 0 0
               OUTLINECOLOR 255 0 0
               SIZE 8
           END
    END
  END
END


It doesn't show anything, just a white rectangle. Not even an error.
But when I display just points it works fine (using "PointsFromColumns").

I hope you could help me.

Thanks,

Pablo Molina S.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20080404/bd359450/attachment.html


More information about the mapserver-users mailing list