Re: [Geoserver-users] SLD files

2011-10-31 Thread Andy Berry
Solution was to remove the # from the colour and present as the original 
decimal provided by mapinfo easyloader. I have listed the whole style for any 
one who wants it.
Thanks for your help

?xml version=1.0 encoding=ISO-8859-1?
StyledLayerDescriptor version=1.0.0 
xmlns=http://www.opengis.net/sld; 
xmlns:ogc=http://www.opengis.net/ogc;
 xmlns:xlink=http://www.w3.org/1999/xlink; 
 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
 xsi:schemaLocation=http://www.opengis.net/sld 
http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd;
  NamedLayer
NameMapinfo Line Colour setting/Name
UserStyle
  TitleColour settings/Title
  AbstractRead pen and colour from MI_STYLE uploaded from mapinfo using 
Easyloader to postgis/Abstract
  FeatureTypeStyle
 Rule
 NameSet Line Colour Thickness/Name
 ogc:Filter
ogc:PropertyIsEqualTo
ogc:Function name=strSubstring
ogc:PropertyNameMI_STYLE/ogc:PropertyName
ogc:Literal0/ogc:Literal
ogc:Literal3/ogc:Literal
/ogc:Function
ogc:LiteralPen/ogc:Literal
/ogc:PropertyIsEqualTo
 /ogc:Filter
LineSymbolizer
  Stroke
CssParameter name=stroke
  ogc:Function name=parseInt
ogc:Function name=strSubstring
  ogc:PropertyNameMI_STYLE/ogc:PropertyName
  ogc:Add
ogc:Function name=strLastIndexOf

ogc:PropertyNameMI_STYLE/ogc:PropertyName
ogc:Literal,/ogc:Literal
/ogc:Function
  ogc:Literal2/ogc:Literal
  /ogc:Add
  ogc:Function name=strLastIndexOf
ogc:PropertyNameMI_STYLE/ogc:PropertyName
ogc:Literal)/ogc:Literal
  /ogc:Function 
/ogc:Function
  /ogc:Function
/CssParameter
CssParameter name=stroke-width
  ogc:Function name=parseInt
ogc:Function name=strSubstring
  ogc:PropertyNameMI_STYLE/ogc:PropertyName
  ogc:Literal5/ogc:Literal
  ogc:Function name=strIndexOf
ogc:PropertyNameMI_STYLE/ogc:PropertyName
ogc:Literal,/ogc:Literal
  /ogc:Function
/ogc:Function
  /ogc:Function
/CssParameter
  /Stroke
   /LineSymbolizer
 /Rule
 Rule
 NameDefault Colour Thickness/Name
 ogc:Filter
ogc:PropertyIsNotEqualTo
ogc:Function name=strSubstring
ogc:PropertyNameMI_STYLE/ogc:PropertyName
ogc:Literal0/ogc:Literal
ogc:Literal3/ogc:Literal
/ogc:Function
ogc:LiteralPen/ogc:Literal
/ogc:PropertyIsNotEqualTo
/ogc:Filter
   LineSymbolizer
  Stroke
CssParameter name=stroke#00/CssParameter
CssParameter name=stroke-width1/CssParameter
  /Stroke
   /LineSymbolizer
 /Rule
   /FeatureTypeStyle
/UserStyle
  /NamedLayer
/StyledLayerDescriptor

-Original Message-
From: Milo van der Linden [mailto:m...@dogodigi.net] 
Sent: 30 October 2011 10:43
To: Andrea Aime
Cc: Andy Berry; geoserver-users@lists.sourceforge.net
Subject: Re: [Geoserver-users] SLD files

The MapInfo color coding scheme is documented here:
http://georezo.net/jparis/MI_Enviro/Colors/color_models.htm#6-1%20R,G,B%20%3C%3E%20RGB

RGB = (65536 * R)  +  (256 * G)  +  B

With this formula, you should be able to get the R, G and B and
transform them to hex.

2011/10/30 Andrea Aime andrea.a...@geo-solutions.it:
 On Fri, Oct 28, 2011 at 2:12 PM, Andy Berry andy.be...@wrexham.gov.uk wrote:
 I am trying to display lines with specific attributes contained in a  field

 The field (from Mapinfo) contains for example Pen(4, 2, 16711935)

 I will need to convert the 3rd number to a hex colour and the first to the
 line thickness

 So far I have

    LineSymbolizer

     Stroke

         CssParameter name=stroke

     #FF

     /CssParameter

     CssParameter name=stroke-width

     ogc:Function name=strSubstring


 ogc:PropertyNameMI_STYLE/ogc:PropertyName


 ogc:Literal5/ogc:Literal


 ogc:Function name=strIndexOf


     ogc:PropertyNameMI_STYLE/ogc:PropertyName


 ogc:Literal,/ogc:Literal


 /ogc:Function

     /ogc:Function

     /CssParameter

     /Stroke

    /LineSymbolizer

 The difficulty is working out how to convert the number

Re: [Geoserver-users] SLD files

2011-10-30 Thread Andrea Aime
On Fri, Oct 28, 2011 at 2:12 PM, Andy Berry andy.be...@wrexham.gov.uk wrote:
 I am trying to display lines with specific attributes contained in a  field

 The field (from Mapinfo) contains for example Pen(4, 2, 16711935)

 I will need to convert the 3rd number to a hex colour and the first to the
 line thickness

 So far I have

    LineSymbolizer

     Stroke

         CssParameter name=stroke

     #FF

     /CssParameter

     CssParameter name=stroke-width

     ogc:Function name=strSubstring


 ogc:PropertyNameMI_STYLE/ogc:PropertyName


 ogc:Literal5/ogc:Literal


 ogc:Function name=strIndexOf


     ogc:PropertyNameMI_STYLE/ogc:PropertyName


 ogc:Literal,/ogc:Literal


 /ogc:Function

     /ogc:Function

     /CssParameter

     /Stroke

    /LineSymbolizer

 The difficulty is working out how to convert the number 1671168 to the hex
 colour, in this case #FF. Has anyone done this before?

I can't think of a good way to do that with the current toolset.
I guess one would need some new filter functions that can do the parsing you
need, that at the moment requires some java programming (we have been talking
about having some scripting ability for a while, but so far nothing is
evolved enough
to ship with GeoServer, even if just as an extension)

Cheers
Andrea

-- 
---
Ing. Andrea Aime
GeoSolutions S.A.S.
Tech lead

Via Poggio alle Viti 1187
55054  Massarosa (LU)
Italy

phone: +39 0584 962313
fax:      +39 0584 962313

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.youtube.com/user/GeoSolutionsIT
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf

---

--
Get your Android app more play: Bring it to the BlackBerry PlayBook 
in minutes. BlackBerry App World#153; now supports Android#153; Apps 
for the BlackBerryreg; PlayBook#153;. Discover just how easy and simple 
it is! http://p.sf.net/sfu/android-dev2dev
___
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users


Re: [Geoserver-users] SLD files

2011-10-30 Thread Milo van der Linden
The MapInfo color coding scheme is documented here:
http://georezo.net/jparis/MI_Enviro/Colors/color_models.htm#6-1%20R,G,B%20%3C%3E%20RGB

RGB = (65536 * R)  +  (256 * G)  +  B

With this formula, you should be able to get the R, G and B and
transform them to hex.

2011/10/30 Andrea Aime andrea.a...@geo-solutions.it:
 On Fri, Oct 28, 2011 at 2:12 PM, Andy Berry andy.be...@wrexham.gov.uk wrote:
 I am trying to display lines with specific attributes contained in a  field

 The field (from Mapinfo) contains for example Pen(4, 2, 16711935)

 I will need to convert the 3rd number to a hex colour and the first to the
 line thickness

 So far I have

    LineSymbolizer

     Stroke

         CssParameter name=stroke

     #FF

     /CssParameter

     CssParameter name=stroke-width

     ogc:Function name=strSubstring


 ogc:PropertyNameMI_STYLE/ogc:PropertyName


 ogc:Literal5/ogc:Literal


 ogc:Function name=strIndexOf


     ogc:PropertyNameMI_STYLE/ogc:PropertyName


 ogc:Literal,/ogc:Literal


 /ogc:Function

     /ogc:Function

     /CssParameter

     /Stroke

    /LineSymbolizer

 The difficulty is working out how to convert the number 1671168 to the hex
 colour, in this case #FF. Has anyone done this before?

 I can't think of a good way to do that with the current toolset.
 I guess one would need some new filter functions that can do the parsing you
 need, that at the moment requires some java programming (we have been talking
 about having some scripting ability for a while, but so far nothing is
 evolved enough
 to ship with GeoServer, even if just as an extension)

 Cheers
 Andrea

 --
 ---
 Ing. Andrea Aime
 GeoSolutions S.A.S.
 Tech lead

 Via Poggio alle Viti 1187
 55054  Massarosa (LU)
 Italy

 phone: +39 0584 962313
 fax:      +39 0584 962313

 http://www.geo-solutions.it
 http://geo-solutions.blogspot.com/
 http://www.youtube.com/user/GeoSolutionsIT
 http://www.linkedin.com/in/andreaaime
 http://twitter.com/geowolf

 ---

 --
 Get your Android app more play: Bring it to the BlackBerry PlayBook
 in minutes. BlackBerry App World#153; now supports Android#153; Apps
 for the BlackBerryreg; PlayBook#153;. Discover just how easy and simple
 it is! http://p.sf.net/sfu/android-dev2dev
 ___
 Geoserver-users mailing list
 Geoserver-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/geoserver-users


--
Get your Android app more play: Bring it to the BlackBerry PlayBook 
in minutes. BlackBerry App World#153; now supports Android#153; Apps 
for the BlackBerryreg; PlayBook#153;. Discover just how easy and simple 
it is! http://p.sf.net/sfu/android-dev2dev
___
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users


[Geoserver-users] SLD files

2011-10-28 Thread Andy Berry
I am trying to display lines with specific attributes contained in a  field
The field (from Mapinfo) contains for example Pen(4, 2, 16711935)
I will need to convert the 3rd number to a hex colour and the first to the line 
thickness
So far I have
   LineSymbolizer
Stroke
CssParameter name=stroke
#FF
/CssParameter
CssParameter name=stroke-width
ogc:Function name=strSubstring

ogc:PropertyNameMI_STYLE/ogc:PropertyName

ogc:Literal5/ogc:Literal
ogc:Function 
name=strIndexOf

ogc:PropertyNameMI_STYLE/ogc:PropertyName

ogc:Literal,/ogc:Literal
/ogc:Function
/ogc:Function
/CssParameter
/Stroke
   /LineSymbolizer
The difficulty is working out how to convert the number 1671168 to the hex 
colour, in this case #FF. Has anyone done this before?

Take a look - you can pay, report, request, have your say and find information 
online at www.wrexham.gov.uk.  

Save paper - think before you print!

This e-mail message and any attachments are intended solely for the individual 
or organisation to whom it is addressed. For full conditions in relation to 
content and use of this e-mail message and any attachments, please refer to 
http://www.wrexham.gov.uk/top_navigation/disclaimers.htm.

Mae'r neges e-bost hon ac unrhyw atodiadau wedi eu bwriadu ar gyfer yr unigolyn 
neu?r sefydliad y?i cyfeirir atynt yn unig.
Am yr amodau llawn ynglyn a chynnwys a defnyddio?r neges e-bost hon ac unrhyw 
atodiadau, cyfeiriwch at   
http://www.wrecsam.gov.uk/top_navigation/disclaimersw.htm.
--
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Cisco Self-Assessment and learn 
about Cisco certifications, training, and career opportunities. 
http://p.sf.net/sfu/cisco-dev2dev___
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users