banniere

Le portail francophone de la géomatique


Toujours pas inscrit ? Mot de passe oublié ?
Nom d'utilisateur    Mot de passe              Toujours pas inscrit ?   Mot de passe oublié ?

Annonce

GEODATA DAYS 2024

#1 Fri 18 April 2008 15:05

king
Participant occasionnel
Date d'inscription: 2 Mar 2008
Messages: 10

comment generer un fichier SLD?

bonjour
mon probleme est que je veux generer une fichier de style (.sld) pour l'utuliser sous geoserver
mais je sais pas comment?
arcGIS peut generer ce type de fichier?
y a t-il autre solution?
j'ai besoin de votre aide
merci

Hors ligne

 

#2 Fri 18 April 2008 15:23

Yves
Membre du bureau
Lieu: Aix-les-Bains
Date d'inscription: 22 Mar 2006
Messages: 9864
Site web

Re: comment generer un fichier SLD?

Bonjour,

gvSIG permet d'exporter ses styles au format SLD. Je pense qu'uDIG pourrait le faire mais je n'ai jamais testé.

Y.


Yves Jacolin, bénévole de l'association GeoRezo.net, agit au nom et pour le compte de l'association - Partageons ce qui nous départage !!  - GeoRezo vous aide ? Aidez GeoRezo !

Hors ligne

 

#3 Mon 21 April 2008 12:05

king
Participant occasionnel
Date d'inscription: 2 Mar 2008
Messages: 10

Re: comment generer un fichier SLD?

merci beaucoup de votre aide
mais lorsque j'utilise le SLD generer par gvSIG sous geoserver elle ne marche pas
lorsque j'ajoute un nouveau style dans geoserver il m'affiche:

Code:

1: <?xml version="1.0" encoding="UTF-8"?>
2: 
3: <StyledLayerDescriptor version="1.0.0" >
4:   <NamedLayer>
5:     <Name>tunis_gouv_region</Name>
6:     <UserStyle>
7:       <FeatureTypeStyle>
---------------------------------------------^
       TargetNamespace.2: Expecting no namespace, but the schema document has a target namespace.
------------------------------------------^
       cvc-elt.1: Cannot find the declaration of element 'StyledLayerDescriptor'.
---------------------------------------------^
       TargetNamespace.2: Expecting no namespace, but the schema document has a target namespace.
---------------------------------------------^
       TargetNamespace.2: Expecting no namespace, but the schema document has a target namespace.
---------------------------------------------^
       TargetNamespace.2: Expecting no namespace, but the schema document has a target namespace.
---------------------------------------------^
       TargetNamespace.2: Expecting no namespace, but the schema document has a target namespace.
---------------------------------------------^
       TargetNamespace.2: Expecting no namespace, but the schema document has a target namespace.
---------------------------------------------^
       TargetNamespace.2: Expecting no namespace, but the schema document has a target namespace.
---------------------------------------------^
       TargetNamespace.2: Expecting no namespace, but the schema document has a target namespace.
---------------------------------------------^
       TargetNamespace.2: Expecting no namespace, but the schema document has a target namespace.
---------------------------------------------^
       TargetNamespace.2: Expecting no namespace, but the schema document has a target namespace.
---------------------------------------------^
       TargetNamespace.2: Expecting no namespace, but the schema document has a target namespace.
---------------------------------------------^
       TargetNamespace.2: Expecting no namespace, but the schema document has a target namespace.
---------------------------------------------^
       TargetNamespace.2: Expecting no namespace, but the schema document has a target namespace.
---------------------------------------------^
       TargetNamespace.2: Expecting no namespace, but the schema document has a target namespace.
---------------------------------------------^
       TargetNamespace.2: Expecting no namespace, but the schema document has a target namespace.
---------------------------------------------^
       TargetNamespace.2: Expecting no namespace, but the schema document has a target namespace.
---------------------------------------------^
       TargetNamespace.2: Expecting no namespace, but the schema document has a target namespace.
---------------------------------------------^
       TargetNamespace.2: Expecting no namespace, but the schema document has a target namespace.
---------------------------------------------^
       TargetNamespace.2: Expecting no namespace, but the schema document has a target namespace.
---------------------------------------------^
       TargetNamespace.2: Expecting no namespace, but the schema document has a target namespace.
---------------------------------------------^
       TargetNamespace.2: Expecting no namespace, but the schema document has a target namespace.
---------------------------------------------^
       TargetNamespace.2: Expecting no namespace, but the schema document has a target namespace.
---------------------------------------------^
       TargetNamespace.2: Expecting no namespace, but the schema document has a target namespace.
---------------------------------------------^
       TargetNamespace.2: Expecting no namespace, but the schema document has a target namespace.
---------------------------------------------^
       TargetNamespace.2: Expecting no namespace, but the schema document has a target namespace.
---------------------------------------------^
       TargetNamespace.2: Expecting no namespace, but the schema document has a target namespace.
---------------------------------------------^
       TargetNamespace.2: Expecting no namespace, but the schema document has a target namespace.
---------------------------------------------^
       TargetNamespace.2: Expecting no namespace, but the schema document has a target namespace.
---------------------------------------------^
       TargetNamespace.2: Expecting no namespace, but the schema document has a target namespace.
---------------------------------------------^
       TargetNamespace.2: Expecting no namespace, but the schema document has a target namespace.
---------------------------------------------^
       TargetNamespace.2: Expecting no namespace, but the schema document has a target namespace.
---------------------------------------------^
       TargetNamespace.2: Expecting no namespace, but the schema document has a target namespace.
---------------------------------------------^
       TargetNamespace.2: Expecting no namespace, but the schema document has a target namespace.
---------------------------------------------^
       TargetNamespace.2: Expecting no namespace, but the schema document has a target namespace.
---------------------------------------------^
       TargetNamespace.2: Expecting no namespace, but the schema document has a target namespace.
---------------------------------------------^
       TargetNamespace.2: Expecting no namespace, but the schema document has a target namespace.
---------------------------------------------^
       TargetNamespace.2: Expecting no namespace, but the schema document has a target namespace.
---------------------------------------------^
       TargetNamespace.2: Expecting no namespace, but the schema document has a target namespace.
---------------------------------------------^
       TargetNamespace.2: Expecting no namespace, but the schema document has a target namespace.
---------------------------------------------^
       TargetNamespace.2: Expecting no namespace, but the schema document has a target namespace.
---------------------------------------------^
       TargetNamespace.2: Expecting no namespace, but the schema document has a target namespace.
---------------------------------------------^
       TargetNamespace.2: Expecting no namespace, but the schema document has a target namespace.
---------------------------------------------^
       TargetNamespace.2: Expecting no namespace, but the schema document has a target namespace.
---------------------------------------------^
       TargetNamespace.2: Expecting no namespace, but the schema document has a target namespace.
---------------------------------------------^
       TargetNamespace.2: Expecting no namespace, but the schema document has a target namespace.
---------------------------------------------^
       TargetNamespace.2: Expecting no namespace, but the schema document has a target namespace.
---------------------------------------------^
       TargetNamespace.2: Expecting no namespace, but the schema document has a target namespace.
---------------------------------------------^
       TargetNamespace.2: Expecting no namespace, but the schema document has a target namespace.
---------------------------------------------^
       TargetNamespace.2: Expecting no namespace, but the schema document has a target namespace.
---------------------------------------------^
       TargetNamespace.2: Expecting no namespace, but the schema document has a target namespace.
---------------------------------------------^
       TargetNamespace.2: Expecting no namespace, but the schema document has a target namespace.
---------------------------------------------^
       TargetNamespace.2: Expecting no namespace, but the schema document has a target namespace.
---------------------------------------------^
       TargetNamespace.2: Expecting no namespace, but the schema document has a target namespace.
---------------------------------------------^
       TargetNamespace.2: Expecting no namespace, but the schema document has a target namespace.
---------------------------------------------^
       TargetNamespace.2: Expecting no namespace, but the schema document has a target namespace.
---------------------------------------------^
       TargetNamespace.2: Expecting no namespace, but the schema document has a target namespace.
---------------------------------------------^
       TargetNamespace.2: Expecting no namespace, but the schema document has a target namespace.
8:         <FeatureTypeName>POP_04</FeatureTypeName>
9:         <Rule>
10:           <Name>97526.0 - 160963.0</Name>
11:           <Filter>
12:             <And>
13:               <PropertyIsGreaterThanOrEqualTo>
14:                 <PropertyName>POP_04</PropertyName>
15:                 <Literal>97526.0</Literal>
16:               </PropertyIsGreaterThanOrEqualTo>
17:               <PropertyIsLessThanOrEqualTo>
18:                 <PropertyName>POP_04</PropertyName>
19:                 <Literal>160963.0</Literal>
20:               </PropertyIsLessThanOrEqualTo>
21:             </And>
22:           </Filter>
23:         </Rule>
24:         <Rule>
25:           <Name>233985.0 - 342630.0</Name>
26:           <Filter>
27:             <And>
28:               <PropertyIsGreaterThanOrEqualTo>
29:                 <PropertyName>POP_04</PropertyName>
30:                 <Literal>233985.0</Literal>
31:               </PropertyIsGreaterThanOrEqualTo>
32:               <PropertyIsLessThanOrEqualTo>
33:                 <PropertyName>POP_04</PropertyName>
34:                 <Literal>342630.0</Literal>
35:               </PropertyIsLessThanOrEqualTo>
36:             </And>
37:           </Filter>
38:         </Rule>
39:         <Rule>
40:           <Name>377852.99999999994 - 455590.0</Name>
41:           <Filter>
42:             <And>
43:               <PropertyIsGreaterThanOrEqualTo>
44:                 <PropertyName>POP_04</PropertyName>
45:                 <Literal>377852.99999999994</Literal>
46:               </PropertyIsGreaterThanOrEqualTo>
47:               <PropertyIsLessThanOrEqualTo>
48:                 <PropertyName>POP_04</PropertyName>
49:                 <Literal>455590.0</Literal>
50:               </PropertyIsLessThanOrEqualTo>
51:             </And>
52:           </Filter>
53:         </Rule>
54:         <Rule>
55:           <Name>505772.99999999994 - 693889.9999999999</Name>
56:           <Filter>
57:             <And>
58:               <PropertyIsGreaterThanOrEqualTo>
59:                 <PropertyName>POP_04</PropertyName>
60:                 <Literal>505772.99999999994</Literal>
61:               </PropertyIsGreaterThanOrEqualTo>
62:               <PropertyIsLessThanOrEqualTo>
63:                 <PropertyName>POP_04</PropertyName>
64:                 <Literal>693889.9999999999</Literal>
65:               </PropertyIsLessThanOrEqualTo>
66:             </And>
67:           </Filter>
68:         </Rule>
69:         <Rule>
70:           <Name>855256.0 - 983861.0</Name>
71:           <Filter>
72:             <And>
73:               <PropertyIsGreaterThanOrEqualTo>
74:                 <PropertyName>POP_04</PropertyName>
75:                 <Literal>855256.0</Literal>
76:               </PropertyIsGreaterThanOrEqualTo>
77:               <PropertyIsLessThanOrEqualTo>
78:                 <PropertyName>POP_04</PropertyName>
79:                 <Literal>983861.0</Literal>
80:               </PropertyIsLessThanOrEqualTo>
81:             </And>
82:           </Filter>
83:         </Rule>
84:       </FeatureTypeStyle>
85:     </UserStyle>
86:   </NamedLayer>
87: </StyledLayerDescriptor>

Hors ligne

 

#4 Mon 21 April 2008 12:33

king
Participant occasionnel
Date d'inscription: 2 Mar 2008
Messages: 10

Re: comment generer un fichier SLD?

j'ai besoin de votre aide
quelq'un peut m'aider?
merci

Hors ligne

 

#5 Mon 21 April 2008 17:17

king
Participant occasionnel
Date d'inscription: 2 Mar 2008
Messages: 10

Re: comment generer un fichier SLD?

toujours probleme de SLD
lors de l'exportation de ma fichier SLD par geoserver tout se passe sans erreur
mais lorsque je veux visualiser ma carte, geoserver m'affiche une page vide
et je comprend pas où le probleme
voici mon code de SLD

Code:

<?xml version="1.0" encoding="ISO-8859-1"?>
<StyledLayerDescriptor version="1.0.0" 
    xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd" 
    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">
  <NamedLayer>
    <Name>Default Line</Name>
    <UserStyle>
      <Title>A boring default style</Title>
      <Abstract>A sample style that just prints out a green line</Abstract>
      <FeatureTypeStyle>
        <FeatureTypeName>POP_04</FeatureTypeName>
        <Rule>
          <Name>97526.0 - 160963.0</Name>
          <ogc:Filter>
            <ogc:And>
              <ogc:PropertyIsGreaterThanOrEqualTo>
                <ogc:PropertyName>POP_04</ogc:PropertyName>
                <ogc:Literal>97526.0</ogc:Literal>
              </ogc:PropertyIsGreaterThanOrEqualTo>
              <ogc:PropertyIsLessThanOrEqualTo>
                <ogc:PropertyName>POP_04</ogc:PropertyName>
                <ogc:Literal>160963.0</ogc:Literal>
              </ogc:PropertyIsLessThanOrEqualTo>
            </ogc:And>
            </ogc:Filter>
<PolygonSymbolizer>
  <Fill>
    <CssParameter name="fill" >#FF3333</CssParameter>
  </Fill>
  <Stroke>
    <CssParameter name="stroke" >#B22323</CssParameter>
    <CssParameter name="stroke-width" >1.0</CssParameter>
  </Stroke>
</PolygonSymbolizer>
          
        </Rule>
        <Rule>
          <Name>233985.0 - 342630.0</Name>
          <ogc:Filter>
            <ogc:And>
              <ogc:PropertyIsGreaterThanOrEqualTo>
                <ogc:PropertyName>POP_04</ogc:PropertyName>
                <ogc:Literal>233985.0</ogc:Literal>
              </ogc:PropertyIsGreaterThanOrEqualTo>
              <ogc:PropertyIsLessThanOrEqualTo>
                <ogc:PropertyName>POP_04</ogc:PropertyName>
                <ogc:Literal>342630.0</ogc:Literal>
              </ogc:PropertyIsLessThanOrEqualTo>
            </ogc:And>
            </ogc:Filter>
<PolygonSymbolizer>
  <Fill>
    <CssParameter name="fill" >#EB3329</CssParameter>
  </Fill>
  <Stroke>
    <CssParameter name="stroke" >#A4231C</CssParameter>
    <CssParameter name="stroke-width" >1.0</CssParameter>
  </Stroke>
</PolygonSymbolizer>
          
        </Rule>
        <Rule>
          <Name>377853.0 - 455590.0</Name>
          <ogc:Filter>
            <ogc:And>
              <ogc:PropertyIsGreaterThanOrEqualTo>
                <ogc:PropertyName>POP_04</ogc:PropertyName>
                <ogc:Literal>377853.0</ogc:Literal>
              </ogc:PropertyIsGreaterThanOrEqualTo>
              <ogc:PropertyIsLessThanOrEqualTo>
                <ogc:PropertyName>POP_04</ogc:PropertyName>
                <ogc:Literal>455590.0</ogc:Literal>
              </ogc:PropertyIsLessThanOrEqualTo>
            </ogc:And>
            </ogc:Filter>
<PolygonSymbolizer>
  <Fill>
    <CssParameter name="fill" >#D7331F</CssParameter>
  </Fill>
  <Stroke>
    <CssParameter name="stroke" >#962315</CssParameter>
    <CssParameter name="stroke-width" >1.0</CssParameter>
  </Stroke>
</PolygonSymbolizer>
         
        </Rule>
        <Rule>
          <Name>505773.0 - 693890.0</Name>
          <ogc:Filter>
            <ogc:And>
              <ogc:PropertyIsGreaterThanOrEqualTo>
                <ogc:PropertyName>POP_04</ogc:PropertyName>
                <ogc:Literal>505773.0</ogc:Literal>
              </ogc:PropertyIsGreaterThanOrEqualTo>
              <ogc:PropertyIsLessThanOrEqualTo>
                <ogc:PropertyName>POP_04</ogc:PropertyName>
                <ogc:Literal>693890.0</ogc:Literal>
              </ogc:PropertyIsLessThanOrEqualTo>
            </ogc:And>
            </ogc:Filter>
<PolygonSymbolizer>
  <Fill>
    <CssParameter name="fill" >#C33315</CssParameter>
  </Fill>
  <Stroke>
    <CssParameter name="stroke" >#88230E</CssParameter>
    <CssParameter name="stroke-width" >1.0</CssParameter>
  </Stroke>
</PolygonSymbolizer>          
        </Rule>
        <Rule>
          <Name>855256.0 - 983861.0</Name>
          <ogc:Filter>
            <ogc:And>
              <ogc:PropertyIsGreaterThanOrEqualTo>
                <ogc:PropertyName>POP_04</ogc:PropertyName>
                <ogc:Literal>855256.0</ogc:Literal>
              </ogc:PropertyIsGreaterThanOrEqualTo>
              <ogc:PropertyIsLessThanOrEqualTo>
                <ogc:PropertyName>POP_04</ogc:PropertyName>
                <ogc:Literal>983861.0</ogc:Literal>
              </ogc:PropertyIsLessThanOrEqualTo>
            </ogc:And>
            </ogc:Filter>
<PolygonSymbolizer>
  <Fill>
    <CssParameter name="fill" >#AF330B</CssParameter>
  </Fill>
  <Stroke>
    <CssParameter name="stroke" >#7A2307</CssParameter>
    <CssParameter name="stroke-width" >1.0</CssParameter>
  </Stroke>
</PolygonSymbolizer>
          
        </Rule>
      </FeatureTypeStyle>
    </UserStyle>
  </NamedLayer>
  </StyledLayerDescriptor>

aidez moi SVP

Hors ligne

 

#6 Tue 22 April 2008 16:23

cbredel
Participant actif
Lieu: Agape Lorraine Nord
Date d'inscription: 20 Feb 2006
Messages: 99
Site web

Re: comment generer un fichier SLD?

Bonjour

De mon coté, je réalise mes sld avec Udig et je les recupère sans problème avec GeoServer (1.5)

Au vue de ton erreur peut-être faut-il que tes balises précise un namespace. Avec un export de uDIG, j'ai quelques choses de la forme :

<?xml version="1.0" encoding="UTF-8"?>
<sld:StyledLayerDescriptor xmlns:sld="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml" version="1.0.0">
    <sld:UserLayer>
        <sld:LayerFeatureConstraints>
            <sld:FeatureTypeConstraint/>
        </sld:LayerFeatureConstraints>
        <sld:UserStyle>
...


Cordialement

Hors ligne

 

#7 Thu 24 April 2008 15:03

king
Participant occasionnel
Date d'inscription: 2 Mar 2008
Messages: 10

Re: comment generer un fichier SLD?

merci cbredel
j'ai resolu mon problème
et voila une partie de mon code:

Code:

<?xml version="1.0" encoding="UTF-8"?>

  <StyledLayerDescriptor version="1.0.0"
  xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd" 
    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">
  <NamedLayer>
  <Name>geo:USGS_Quat_Faults</Name>
  <UserStyle>
  <Name>geothermalgeo:USGS_Quat_Faults</Name>
  <Title>Geothermal</Title>
  <Abstract>Geothermal filters</Abstract>
    <FeatureTypeStyle>
      <Rule>
             <!-- Theme 1 -->
              <Filter xmlns="http://www.opengis.net/ogc">
                <PropertyIsBetween>
                  <PropertyName>POP_94</PropertyName>
                  <LowerBoundary>
                    <Literal>89055.0</Literal>
                  </LowerBoundary>
                  <UpperBoundary>
                    <Literal>143036.0</Literal>
                  </UpperBoundary>
                </PropertyIsBetween>
              </Filter>
        <PolygonSymbolizer>
   
  <Fill>
    <CssParameter name="fill" >#CC3300</CssParameter>
  </Fill>
  <Stroke>
    <CssParameter name="stroke" >#8E2300</CssParameter>
    <CssParameter name="stroke-width" >1</CssParameter>
  </Stroke>
</PolygonSymbolizer>

Hors ligne

 

#8 Sun 07 September 2008 00:31

aigle_marocain
Participant occasionnel
Date d'inscription: 7 Sep 2008
Messages: 18

Re: comment generer un fichier SLD?

est ce que tu peut me dire ou ui je trouver des exemples de fichiers SLD sur net

Hors ligne

 

#9 Mon 08 September 2008 09:16

Beaufreton
Participant occasionnel
Date d'inscription: 24 Jul 2006
Messages: 26

Re: comment generer un fichier SLD?

Bonjour,  vous devriez trouver tous les samples dont vous avez besoin à cette adresse:
http://maps.massgis.state.ma.us/geoserver_sld/

Hors ligne

 

#10 Mon 08 September 2008 18:46

Yves
Membre du bureau
Lieu: Aix-les-Bains
Date d'inscription: 22 Mar 2006
Messages: 9864
Site web

Re: comment generer un fichier SLD?

Bonjour,

D'autres possibilités existent pour générer des fichiers SLD : Utiliser une requête "GetStyles" dans un service WMS ou bien utiliser un éditeur SLD : http://www.eightahead.com/sld_editor/sl … point.html (source : http://trac.openlayers.org/wiki/Addins/StyleEditor).

Y.


Yves Jacolin, bénévole de l'association GeoRezo.net, agit au nom et pour le compte de l'association - Partageons ce qui nous départage !!  - GeoRezo vous aide ? Aidez GeoRezo !

Hors ligne

 

#11 Tue 09 September 2008 09:28

Beaufreton
Participant occasionnel
Date d'inscription: 24 Jul 2006
Messages: 26

Re: comment generer un fichier SLD?

Bonjour,
Autrement vous avez geotools, une API java qui fournit des classes pour générer des SLD ainsi qu'un connecteur WMS et WFS.

Hors ligne

 

#12 Sun 14 September 2008 00:52

aigle_marocain
Participant occasionnel
Date d'inscription: 7 Sep 2008
Messages: 18

Re: comment generer un fichier SLD?

Merci les gas pour vos amples informations que dieu bénisse les forunms de discussions.

un autre petit probleme si qq1 a une solution

est il possible d'arreter le zoom dans une map a une echelle donnée pour éviter que l'ecran s'affiche en blanc?
si oui y'a til  un code SLD por le faire.

Hors ligne

 

Pied de page des forums

Powered by FluxBB