[Geoserver-users] SVG Marks

Hello List,

I want to use an external SVG symbol as a mark and I’m using the CSS module for my styling, although I don’t think that makes any difference to this question.

The SVG represents a pin and I want to position the pin so that the base of the pin is drawn at the position for that point, but the pins all seem to be drawn quite away to the left of the actual position.

What considerations do I need to take into account in order to be able to accurately position the SVG symbol relative to the reference coordinate?

Thanks

Chris

*** This communication has been sent from World Fuel Services
Corporation or its subsidiaries or its affiliates for the intended recipient
only and may contain proprietary, confidential or privileged information.
If you are not the intended recipient, any review, disclosure, copying,
use, or distribution of the information included in this communication
and any attachments is strictly prohibited. If you have received this
communication in error, please notify us immediately by replying to this
communication and delete the communication, including any
attachments, from your computer. Electronic communications sent to or
from World Fuel Services Corporation or its subsidiaries or its affiliates
may be monitored for quality assurance and compliance purposes.***

Hi Chris,
Well, if the offset is consistently wrong (i.e., always 3 pixels too far left for instance) the SLD spec may allow you to use a “displacement” parameter (you can for fills with SLD 1.1).

Jonathan

On 30 January 2013 16:22, Chris Haste <CHaste@anonymised.com> wrote:

Hello List,

I want to use an external SVG symbol as a mark and I’m using the CSS module for my styling, although I don’t think that makes any difference to this question.

The SVG represents a pin and I want to position the pin so that the base of the pin is drawn at the position for that point, but the pins all seem to be drawn quite away to the left of the actual position.

What considerations do I need to take into account in order to be able to accurately position the SVG symbol relative to the reference coordinate?

Thanks

Chris

*** This communication has been sent from World Fuel Services
Corporation or its subsidiaries or its affiliates for the intended recipient
only and may contain proprietary, confidential or privileged information.
If you are not the intended recipient, any review, disclosure, copying,
use, or distribution of the information included in this communication
and any attachments is strictly prohibited. If you have received this
communication in error, please notify us immediately by replying to this
communication and delete the communication, including any
attachments, from your computer. Electronic communications sent to or
from World Fuel Services Corporation or its subsidiaries or its affiliates
may be monitored for quality assurance and compliance purposes.***


Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_jan


Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

This transmission is intended for the named addressee(s) only and may contain sensitive or protectively marked material up to RESTRICTED and should be handled accordingly. Unless you are the named addressee (or authorised to receive it for the addressee) you may not copy or use it, or disclose it to anyone else. If you have received this transmission in error please notify the sender immediately. All email traffic sent to or from us, including without limitation all GCSX traffic, may be subject to recording and/or monitoring in accordance with relevant legislation.

Hi Jonathan,

It isn’t a fixed value. The offset seems related to the zoom. As I zoom in the symbols moves closer and closer to where it should be and as I zoom out it moves further away!

I’m sure this is something obvious and that I’m doing something stupid…

From: Jonathan Moules [mailto:jonathanmoules@anonymised.com]
Sent: 30 January 2013 16:36
To: Chris Haste
Cc: geoserver-users@anonymised.comurceforge.net
Subject: Re: [Geoserver-users] SVG Marks

Hi Chris,

Well, if the offset is consistently wrong (i.e., always 3 pixels too far left for instance) the SLD spec may allow you to use a “displacement” parameter (you can for fills with SLD 1.1).

Jonathan

On 30 January 2013 16:22, Chris Haste <CHaste@anonymised.com> wrote:

Hello List,

I want to use an external SVG symbol as a mark and I’m using the CSS module for my styling, although I don’t think that makes any difference to this question.

The SVG represents a pin and I want to position the pin so that the base of the pin is drawn at the position for that point, but the pins all seem to be drawn quite away to the left of the actual position.

What considerations do I need to take into account in order to be able to accurately position the SVG symbol relative to the reference coordinate?

Thanks

Chris

*** This communication has been sent from World Fuel Services
Corporation or its subsidiaries or its affiliates for the intended recipient
only and may contain proprietary, confidential or privileged information.
If you are not the intended recipient, any review, disclosure, copying,
use, or distribution of the information included in this communication
and any attachments is strictly prohibited. If you have received this
communication in error, please notify us immediately by replying to this
communication and delete the communication, including any
attachments, from your computer. Electronic communications sent to or
from World Fuel Services Corporation or its subsidiaries or its affiliates
may be monitored for quality assurance and compliance purposes.***


Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_jan


Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

This transmission is intended for the named addressee(s) only and may contain sensitive or protectively marked material up to RESTRICTED and should be handled accordingly. Unless you are the named addressee (or authorised to receive it for the addressee) you may not copy or use it, or disclose it to anyone else. If you have received this transmission in error please notify the sender immediately. All email traffic sent to or from us, including without limitation all GCSX traffic, may be subject to recording and/or monitoring in accordance with relevant legislation.

On Wed, Jan 30, 2013 at 5:35 PM, Jonathan Moules <jonathanmoules@anonymised.com…4942…> wrote:

Hi Chris,
Well, if the offset is consistently wrong (i.e., always 3 pixels too far left for instance) the SLD spec may allow you to use a “displacement” parameter (you can for fills with SLD 1.1).

Except that we don’t support that part of SLD 1.1, since it was not in SLD 1.0

Cheers
Andrea

==
Our support, Your Success! Visit http://opensdi.geo-solutions.it for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it


what you have to achieve is that the ‘middle point’ of your SVG is the point you want to align with the depicted point on the map. if this is not the case for the natural shape of the SVG, you might want to add a non-visible element to the SVG itself (say, a circle that encoloses all of the SVG, with the circles center point being your wanted center point), and use the SVG that way. from my experience, the SLD rendering engine will try to ‘center’ the SVG so that its center point is the point of reference being drawn. (and the CSS styling is based on the SLD styling)

···

On 30/01/13 17:22, Chris Haste wrote:

Hello List,

I want to use an external SVG symbol as a mark and I’m using the CSS module for my styling, although I don’t think that makes any difference to this question.

The SVG represents a pin and I want to position the pin so that the base of the pin is drawn at the position for that point, but the pins all seem to be drawn quite away to the left of the actual position.

What considerations do I need to take into account in order to be able to accurately position the SVG symbol relative to the reference coordinate?

Thank you, that was the problem and it is now behaving as it should

From: Ákos Maróy [mailto:akos@anonymised.com]
Sent: 30 January 2013 17:05
To: geoserver-users@lists.sourceforge.net
Subject: Re: [Geoserver-users] SVG Marks

On 30/01/13 17:22, Chris Haste wrote:

Hello List,

I want to use an external SVG symbol as a mark and I’m using the CSS module for my styling, although I don’t think that makes any difference to this question.

The SVG represents a pin and I want to position the pin so that the base of the pin is drawn at the position for that point, but the pins all seem to be drawn quite away to the left of the actual position.

What considerations do I need to take into account in order to be able to accurately position the SVG symbol relative to the reference coordinate?

what you have to achieve is that the ‘middle point’ of your SVG is the point you want to align with the depicted point on the map. if this is not the case for the natural shape of the SVG, you might want to add a non-visible element to the SVG itself (say, a circle that encoloses all of the SVG, with the circles center point being your wanted center point), and use the SVG that way.

from my experience, the SLD rendering engine will try to ‘center’ the SVG so that its center point is the point of reference being drawn. (and the CSS styling is based on the SLD styling)

*** This communication has been sent from World Fuel Services
Corporation or its subsidiaries or its affiliates for the intended recipient
only and may contain proprietary, confidential or privileged information.
If you are not the intended recipient, any review, disclosure, copying,
use, or distribution of the information included in this communication
and any attachments is strictly prohibited. If you have received this
communication in error, please notify us immediately by replying to this
communication and delete the communication, including any
attachments, from your computer. Electronic communications sent to or
from World Fuel Services Corporation or its subsidiaries or its affiliates
may be monitored for quality assurance and compliance purposes.***

Yep, I remember that from our previous conversation, but didn’t know if displacement was part of SLD 1.0 for non-fills. I guess not. :slight_smile:

On 30 January 2013 16:50, Andrea Aime <andrea.aime@anonymised.com> wrote:

On Wed, Jan 30, 2013 at 5:35 PM, Jonathan Moules <jonathanmoules@anonymised.com> wrote:

Hi Chris,
Well, if the offset is consistently wrong (i.e., always 3 pixels too far left for instance) the SLD spec may allow you to use a “displacement” parameter (you can for fills with SLD 1.1).

Except that we don’t support that part of SLD 1.1, since it was not in SLD 1.0

Cheers
Andrea

==
Our support, Your Success! Visit http://opensdi.geo-solutions.it for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it


This transmission is intended for the named addressee(s) only and may contain sensitive or protectively marked material up to RESTRICTED and should be handled accordingly. Unless you are the named addressee (or authorised to receive it for the addressee) you may not copy or use it, or disclose it to anyone else. If you have received this transmission in error please notify the sender immediately. All email traffic sent to or from us, including without limitation all GCSX traffic, may be subject to recording and/or monitoring in accordance with relevant legislation.

glad to hear that :slight_smile:

···

On 30/01/13 18:38, Chris Haste wrote:

Thank you, that was the problem and it is now behaving as it should

Chris, what exact technique did you use to solve the problem? Did you use the “invisible circle” technique? Any chance you could post your SVG file to look at?

On Wed, Jan 30, 2013 at 9:38 AM, Chris Haste <CHaste@anonymised.com> wrote:

Thank you, that was the problem and it is now behaving as it should

From: Ákos Maróy [mailto:akos@anonymised.com]
Sent: 30 January 2013 17:05
To: geoserver-users@anonymised.comceforge.net

Subject: Re: [Geoserver-users] SVG Marks

On 30/01/13 17:22, Chris Haste wrote:

Hello List,

I want to use an external SVG symbol as a mark and I’m using the CSS module for my styling, although I don’t think that makes any difference to this question.

The SVG represents a pin and I want to position the pin so that the base of the pin is drawn at the position for that point, but the pins all seem to be drawn quite away to the left of the actual position.

What considerations do I need to take into account in order to be able to accurately position the SVG symbol relative to the reference coordinate?

what you have to achieve is that the ‘middle point’ of your SVG is the point you want to align with the depicted point on the map. if this is not the case for the natural shape of the SVG, you might want to add a non-visible element to the SVG itself (say, a circle that encoloses all of the SVG, with the circles center point being your wanted center point), and use the SVG that way.

from my experience, the SLD rendering engine will try to ‘center’ the SVG so that its center point is the point of reference being drawn. (and the CSS styling is based on the SLD styling)

On 31/01/13 00:16, Martin Davis wrote:

Chris, what exact technique did you use to solve the problem? Did you
use the "invisible circle" technique? Any chance you could post your
SVG file to look at?

I can't speak for Chris, but please look at this SVG which worked for
me:
http://code.google.com/p/openaviationmap/source/browse/trunk/rendering/navaid_designated.svg

here, my goal was that the center of the image is the center point of
the triangle (the point which is of the same distance to all sides of
the triangle)

Hi Martin,

I simply made sure that the SVG symbol was defined on a square grid (100x100) and that the point I wanted as the reference point was located in the middle i.e. 50,50. Once this was done the symbols were positioned exactly where they should have been.

From: Martin Davis [mailto:mtnclimb@anonymised.com]
Sent: 30 January 2013 23:16
To: Chris Haste
Cc: geoserver-users@lists.sourceforge.net
Subject: Re: [Geoserver-users] SVG Marks

Chris, what exact technique did you use to solve the problem? Did you use the “invisible circle” technique? Any chance you could post your SVG file to look at?

On Wed, Jan 30, 2013 at 9:38 AM, Chris Haste <CHaste@anonymised.com> wrote:

Thank you, that was the problem and it is now behaving as it should

From: Ákos Maróy [mailto:akos@anonymised.com]
Sent: 30 January 2013 17:05
To: geoserver-users@lists.sourceforge.net

Subject: Re: [Geoserver-users] SVG Marks

On 30/01/13 17:22, Chris Haste wrote:

Hello List,

I want to use an external SVG symbol as a mark and I’m using the CSS module for my styling, although I don’t think that makes any difference to this question.

The SVG represents a pin and I want to position the pin so that the base of the pin is drawn at the position for that point, but the pins all seem to be drawn quite away to the left of the actual position.

What considerations do I need to take into account in order to be able to accurately position the SVG symbol relative to the reference coordinate?

what you have to achieve is that the ‘middle point’ of your SVG is the point you want to align with the depicted point on the map. if this is not the case for the natural shape of the SVG, you might want to add a non-visible element to the SVG itself (say, a circle that encoloses all of the SVG, with the circles center point being your wanted center point), and use the SVG that way.

from my experience, the SLD rendering engine will try to ‘center’ the SVG so that its center point is the point of reference being drawn. (and the CSS styling is based on the SLD styling)

*** This communication has been sent from World Fuel Services
Corporation or its subsidiaries or its affiliates for the intended recipient
only and may contain proprietary, confidential or privileged information.
If you are not the intended recipient, any review, disclosure, copying,
use, or distribution of the information included in this communication
and any attachments is strictly prohibited. If you have received this
communication in error, please notify us immediately by replying to this
communication and delete the communication, including any
attachments, from your computer. Electronic communications sent to or
from World Fuel Services Corporation or its subsidiaries or its affiliates
may be monitored for quality assurance and compliance purposes.***