MapScript - Show numbered coordinates as numbered dots on a map
Kai Behncke
kbehncke at IGF.UNI-OSNABRUECK.DE
Mon Dec 4 03:11:15 PST 2006
On Mon, 4 Dec 2006 11:16:22 +0100, Martijn van Exel wrote
> Dear scripters,
>
> I have a tab-separated text file containing numbered points (number
> / x / y). I want to parse this file and put the points on the map as
> numbered dots. How do I go about doing this in (C#) MapScript? Can I
> determine the size of the dots and the size, font and colour of the
> numbers? Can I make the numbers appear centered inside the dots?
>
> Much appreciated,
>
Hello Martijn,
this sounds quite interesting.
You can do this easily with PHP/Mapscript.
You can parse the text file in a way, that the x and y -koordinates are
written in a database (PostgreSQL/PostGIS or even Mysql (even without the
spatial extension)).
You can determine the size of the dots.
For example, if your data are in postgresql/postgis, use a new Layer
like:
LAYER
NAME "poi"
STATUS on
TYPE point
LABELCACHE on
CONNECTIONTYPE postgis
CONNECTION "user=postgres dbname=data host=localhost port=5432"
DATA "the_geom from yourtable"
LABELITEM 'punktnumber'
CLASS
STYLE
SYMBOL punkt
COLOR 120 0 0
SIZE 14 # this determines the size of the dot
END
LABEL #this determines the label.
#You can determine size, font and colour of the
# numbers. And you can make the numbers appear centered inside the dots.
TYPE truetype
FONT "arialbd"
SIZE 8
COLOR 0 0 0
OUTLINECOLOR 255 255 255
POSITION cc
ANGLE auto
MINFEATURESIZE auto
END
END
END
Regards, Kai
--
Dipl.-Geogr. Dipl.-Umweltw. Kai Behncke
Institut für Geoinformatik und Fernerkundung (IGF)
Universität Osnabrück
Kolpingstr. 7
49074 Osnabrück
Raum: 01/308
Tel.: +49 541 969-4450
E-Mail: mailto:kbehncke at igf.uni-osnabrueck.de
Web: http://www.igf.uni-osnabrueck.de
More information about the MapServer-users
mailing list