Hello Mr./Miss:

         I am using geotools to rendering my pngs,anything is ok except
that the PointPlacement(I wondering how <AnchorPoint> works.)I'm not
familiar with English,sorry about any grammar mistakes.



Here is my code:

===============

TextSymbolizer ts = builder.createTextSymbolizer();

ts.setLabel(ff.literal("B"));

p.setAnchorPoint(builder.createAnchorPoint(0.5,0.5));

p.setRotation(ff.property("rotation"));

ts.setLabelPlacement(p);

.....

=============================





And here is the explaination about <AnchorPoint> that I found from

02-070_Styled_layer_Descriptor_Implementation_Specification.pdf.(url=
https://portal.opengeospatial.org/files/?artifact_id=1188)

==========

The coordinates are given as tw o floating-point numbers in the  AnchorPointX
and

AnchorPointY elements each with values between  0.0 and 1.0 inclusive.  The
bounding

box of the label to be rendere d is considered to be in a coorindate space
from 0.0 (lower-left corner) to 1.0 (upper-right corner), and the anchor
position is specified as a point in

this space.  The default point is X= 0, Y= 0.5 , which is at the middle
height of the left-hand side of the label.  A system may choose different
anchor  points to de-c onflict labels.







I think that x,y represent the percentage of width and height,for
example,if(x,y) = (0.0,0.5),the anchorpoint of  label="AB" is as the red
point shows below:

[image: 内嵌图片 1]

When I add a rotation,the label will rotate around the anchorpoint.However
the result of my test program is not like this,it's odd and seems
irregular.x and y can be greater than 1, and negative.



Sorry about any troubles,I am in great need of your help.Thank you.

       Any of your reply will be highly appreciated.


              Best Regards,


              zhengheng

<<1.png>>

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and 
their applications. This 200-page book is written by three acclaimed 
leaders in the field. The early access version is available now. 
Download your free book today! http://p.sf.net/sfu/neotech_d2d_may
_______________________________________________
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to