Re: [mapserver-users] MapServer Symbol Conversion from Polyline Points

2008-12-30 Thread Havard Tveite

Precise symbol placement is among the issues that are being
addressed in RFC45 (Symbology, Labeling, and Cartography
Improvements)
http://mapserver.osgeo.org/development/rfc/ms-rfc-45.html>

In RFC45, a new tag called CENTER or ORIGIN is proposed. ANCHORPOINT
is perhaps a better name for it.  This tag could be useful to have
available both with the SYMBOL and with the STYLE.

Cite from RFC45:
CENTER/ORIGIN [x y]
Defines the centre of the symbol using decimal pixels (x axis
increasing to the right, y axis increasing downwards).
* Is used for placing a point symbol on the map or on a “decorated” line
* Defines the centre of rotation if an ANGLE is specified for point symbols.
* Default value is the centre of the symbol’s bounding box.
* Applies to TYPE ellipse, vector, pixmap, truetype.


Håvard Tveite


Bob Basques wrote:

All,

I would vote for both the 0,0 anchoring by default and the use of the 
ANCHORPOINT function.   These things gave me no end of problems when I first 
started out with MapServer.  Took a while to figure out how to anchor oddly 
shaped symbols for example.

bobb




As a side issue, do the positive/negative numbers have a bearing on the
anchor point of the symbol or is that always in the centre of the symbol?

as of now, the symbol is centered on the anchor point. I'd be in favor
of having a way to specify the anchor point, either by fixing it on
0,0 , or by specifying it alongside the symbol, eg ANCHORPOINT 0.3 2

regards,
thomas


___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


RE: [mapserver-users] MapServer Symbol Conversion from Polyline Points

2008-12-29 Thread Steve Lime
I believe the size is computed from the max x, y coordinates and 0,0. That size 
(and the Style size) is then used
to offset the symbol so it is centered accordingly. Typically I always develop 
vector symbols on a unit square (0 
to 1) so that things work predictably. As suggested later in this thread a TTF 
is a nice alternative for anything
complex. I use 'FontCreator' and it works quite nicely.

Steve

>>> On 12/29/2008 at 6:58 AM, in message 
>>> ,
"Donald Kerr"  wrote:
> Thomas,
> 
> Thanks for your prompt reply.
> 
>>> If I take just part of the above then it still doesn't work:
>>>
>>> SYMBOL
>>>NAME 'boulderGeometry'
>>>TYPE VECTOR
>>>FILLED FALSE
>>>POINTS
>>>-0.154 0.236
>>>-0.111 0.365
>>>-0.116 0.501
>>>-0.165 0.616
>>>-0.170 0.627
>>>END # POINTS
>>> END # SYMBOL
> 
>> There's a limitation with the vector code that expects  all 
>> values to be positive when computing the symbol size. I'm 
>> hoping this will be fixed in 5.4 / 6.0
> 
> Is that the reason why the above appears not to work i.e. the size issue? I
> will try changing everything to a positive number to see if that works.
> 
> As a side issue, do the positive/negative numbers have a bearing on the
> anchor point of the symbol or is that always in the centre of the symbol?
> 
> Many thanks.
> 
> Regards,
> 
> Donald
> 
> 
> ___
> mapserver-users mailing list
> mapserver-users@lists.osgeo.org 
> http://lists.osgeo.org/mailman/listinfo/mapserver-users

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


RE: [mapserver-users] MapServer Symbol Conversion from Polyline Points

2008-12-29 Thread Donald Kerr
David,

> Another potential solution would be to create a true type 
> font character and use that as your symbol.

I gave up on trying to recreate the vector symbols and have been working
away to create a font containing all the symbols (about 80 in total). This
seems to work very well and provides a neat way of packaging them for use by
others.

Great suggestion!

Many thanks.

Regards,

Donald

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] MapServer Symbol Conversion from Polyline Points

2008-12-29 Thread Bob Basques
All,

I would vote for both the 0,0 anchoring by default and the use of the 
ANCHORPOINT function.   These things gave me no end of problems when I first 
started out with MapServer.  Took a while to figure out how to anchor oddly 
shaped symbols for example.

bobb



>
> As a side issue, do the positive/negative numbers have a bearing on the
> anchor point of the symbol or is that always in the centre of the symbol?
as of now, the symbol is centered on the anchor point. I'd be in favor
of having a way to specify the anchor point, either by fixing it on
0,0 , or by specifying it alongside the symbol, eg ANCHORPOINT 0.3 2

regards,
thomas
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


RE: [mapserver-users] MapServer Symbol Conversion from Polyline Points

2008-12-29 Thread Donald Kerr
> Another potential solution would be to create a true 
> type font character and use that as your symbol.

That might be worth a try. I'll be working on this problem later today wo
will give it a go and see how I get on. I also want to try getting the
polyline points into a vector format just to satisfy myself that it can be
done that way. The TTF solution might be a bit neater and easier.

Many thanks.

Regards,

Donald

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


RE: [mapserver-users] MapServer Symbol Conversion from Polyline Points

2008-12-29 Thread Fawcett, David
Another potential solution would be to create a true type font character
and use that as your symbol.

-Original Message-
From: mapserver-users-boun...@lists.osgeo.org
[mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of thomas
bonfort
Sent: Monday, December 29, 2008 7:06 AM
To: Donald Kerr
Cc: mapserver-users@lists.osgeo.org
Subject: Re: [mapserver-users] MapServer Symbol Conversion from Polyline
Points


On Mon, Dec 29, 2008 at 13:58, Donald Kerr 
wrote:
> Thomas,
>
> Thanks for your prompt reply.
>
>>> If I take just part of the above then it still doesn't work:
>>>
>>> SYMBOL
>>>NAME 'boulderGeometry'
>>>TYPE VECTOR
>>>FILLED FALSE
>>>POINTS
>>>-0.154 0.236
>>>-0.111 0.365
>>>-0.116 0.501
>>>-0.165 0.616
>>>-0.170 0.627
>>>END # POINTS
>>> END # SYMBOL
>
>> There's a limitation with the vector code that expects  all values to

>> be positive when computing the symbol size. I'm hoping this will be 
>> fixed in 5.4 / 6.0
>
> Is that the reason why the above appears not to work i.e. the size 
> issue? I will try changing everything to a positive number to see if 
> that works.
probably

>
> As a side issue, do the positive/negative numbers have a bearing on 
> the anchor point of the symbol or is that always in the centre of the 
> symbol?
as of now, the symbol is centered on the anchor point. I'd be in favor
of having a way to specify the anchor point, either by fixing it on 0,0
, or by specifying it alongside the symbol, eg ANCHORPOINT 0.3 2

regards,
thomas
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] MapServer Symbol Conversion from Polyline Points

2008-12-29 Thread thomas bonfort
On Mon, Dec 29, 2008 at 13:58, Donald Kerr  wrote:
> Thomas,
>
> Thanks for your prompt reply.
>
>>> If I take just part of the above then it still doesn't work:
>>>
>>> SYMBOL
>>>NAME 'boulderGeometry'
>>>TYPE VECTOR
>>>FILLED FALSE
>>>POINTS
>>>-0.154 0.236
>>>-0.111 0.365
>>>-0.116 0.501
>>>-0.165 0.616
>>>-0.170 0.627
>>>END # POINTS
>>> END # SYMBOL
>
>> There's a limitation with the vector code that expects  all
>> values to be positive when computing the symbol size. I'm
>> hoping this will be fixed in 5.4 / 6.0
>
> Is that the reason why the above appears not to work i.e. the size issue? I
> will try changing everything to a positive number to see if that works.
probably

>
> As a side issue, do the positive/negative numbers have a bearing on the
> anchor point of the symbol or is that always in the centre of the symbol?
as of now, the symbol is centered on the anchor point. I'd be in favor
of having a way to specify the anchor point, either by fixing it on
0,0 , or by specifying it alongside the symbol, eg ANCHORPOINT 0.3 2

regards,
thomas
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


RE: [mapserver-users] MapServer Symbol Conversion from Polyline Points

2008-12-29 Thread Donald Kerr
Thomas,

Thanks for your prompt reply.

>> If I take just part of the above then it still doesn't work:
>>
>> SYMBOL
>>NAME 'boulderGeometry'
>>TYPE VECTOR
>>FILLED FALSE
>>POINTS
>>-0.154 0.236
>>-0.111 0.365
>>-0.116 0.501
>>-0.165 0.616
>>-0.170 0.627
>>END # POINTS
>> END # SYMBOL

> There's a limitation with the vector code that expects  all 
> values to be positive when computing the symbol size. I'm 
> hoping this will be fixed in 5.4 / 6.0

Is that the reason why the above appears not to work i.e. the size issue? I
will try changing everything to a positive number to see if that works.

As a side issue, do the positive/negative numbers have a bearing on the
anchor point of the symbol or is that always in the centre of the symbol?

Many thanks.

Regards,

Donald


___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] MapServer Symbol Conversion from Polyline Points

2008-12-29 Thread thomas bonfort
hi,

On Mon, Dec 29, 2008 at 11:59, Donald Kerr  wrote:
>  the maximum number of points that can be used
by default it's 100. you can change the MS_MAXVECTORPOINTS constant in
mapsymbol.h to change that limit.

> and the highest positive/negative numbers that can be used.
> I believe that "-99" works as 'pen up' but does that mean that -98 and 98
> are the maximum?
-99 is the reserved value for penup, ie you can use -100 for the actual points.

> Also, do the point values have to be integer values? If
> not, how many numbers after the point e.g. 1.12345 etc.
not necessarily integer. you can use as many numbers after the point as you wish

>
> If I take the polyline points like the following then the server throws a
> CGI wobbly and needs restarting:
>
>-0.178,0.619
>END # POINTS
> END # SYMBOL
you've got a comma here, the parser can't recognize two numbers

>
>
> If I take just part of the above then it still doesn't work:
>
> SYMBOL
>NAME 'boulderGeometry'
>TYPE VECTOR
>FILLED FALSE
>POINTS
>-0.154 0.236
>-0.111 0.365
>-0.116 0.501
>-0.165 0.616
>-0.170 0.627
>END # POINTS
> END # SYMBOL

there's a limitation with the vector code that expects  all values to
be positive when computing the symbol size. I'm hoping this will be
fixed in 5.4 / 6.0

regards,
thomas
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


RE: [mapserver-users] MapServer Symbol Conversion from Polyline Points

2008-12-29 Thread Donald Kerr
Just to add a wee bit to this. I have a number of symbols that I would like
to recreate in MapServer. I have an image of what they should look like and
I have the arrays of polyline points. What I don't really know is the
limitations of the MapServer vector points i.e. the maximum number of points
that can be used and the highest positive/negative numbers that can be used.
I believe that "-99" works as 'pen up' but does that mean that -98 and 98
are the maximum? Also, do the point values have to be integer values? If
not, how many numbers after the point e.g. 1.12345 etc.

If I take the polyline points like the following then the server throws a
CGI wobbly and needs restarting:

SYMBOL
NAME 'boulderGeometry'
TYPE VECTOR
FILLED FALSE
POINTS 
-0.154 0.236
-0.111 0.365
-0.116 0.501
-0.165 0.616
-0.170 0.627
-0.264 0.724
-0.490 0.826
-0.682 0.889
-0.885 0.900
-1.083 0.858
-1.264 0.767
-1.415 0.631
-1.521 0.466
-1.558 0.199
-1.538 -0.071
-1.462 -0.329
-1.333 -0.566
-1.156 -0.771
-99 -99
1.755 -0.819
1.534 -0.804
0.832 -0.857
0.129 -0.824
-0.450 -0.769
-1.032 -0.767
-1.612 -0.819
-99 -99
1.640 -0.804
1.620 -0.589
1.392 -0.388
1.122 -0.248
-99 -99
0.311 -0.526
0.520 -0.573
0.732 -0.554
0.930 -0.472
1.093 -0.335
1.097 -0.329
1.101 -0.323
1.105 -0.317
1.108 -0.311
1.111 -0.304
1.113 -0.298
1.115 -0.291
1.117 -0.284
1.118 -0.277
1.118 -0.270
1.119 -0.263
1.118 -0.256
1.118 -0.249
1.117 -0.242
1.115 -0.235
1.113 -0.229
1.111 -0.222
1.108 -0.216
1.105 -0.209
1.101 -0.203
1.097 -0.198
1.093 -0.192
1.088 -0.187
1.083 -0.182
1.078 -0.177
1.073 -0.173
1.067 -0.169
1.061 -0.165
1.054 -0.162
0.637 0.198
0.393 0.388
0.118 0.530
-0.165 0.616
-0.178,0.619
END # POINTS
END # SYMBOL


If I take just part of the above then it still doesn't work:

SYMBOL
NAME 'boulderGeometry'
TYPE VECTOR
FILLED FALSE
POINTS 
-0.154 0.236
-0.111 0.365
-0.116 0.501
-0.165 0.616
-0.170 0.627
END # POINTS
END # SYMBOL

Any help most greatly appreciated.

Regards,

Donald


-Original Message-
From: mapserver-users-boun...@lists.osgeo.org
[mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Donald Kerr
Sent: 28 December 2008 21:39
To: mapserver-users@lists.osgeo.org
Subject: [mapserver-users] MapServer Symbol Conversion from Polyline Points


I've been struggling with this problem all day and cannot make any progress.
I hope that someone can help.

I want to convert a polyline points array into a MapServer Symbol but keep
getting errors.

Here's the polyline array:






And here's a depiction of the symbol I need to create:

http://www.dkerr.co.uk/boulderGeography.gif

Many thanks.

Regards,

Donald

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users