Hexagon Geospatial
MENU

Support ERDAS APOLLO

Wondering how others have configured their ERDAS APOLLO server or what data they are crawling? The ERDAS APOLLO Discussion board is a place to find information, share ideas and more. Join the community, connect, contribute and share.
Showing results for 
Search instead for 
Do you mean 
Reply
New Contributor
Posts: 4
Registered: ‎03-13-2018

Workflow to use SLD files with WMS

Hello, I would like to provide a basemap with data managed within Apollo as a WMS.  We will be using Leaflet to show this basemap.  Currently it works but does not have any custom styles for the features.  I have created SLD files that I would like to use that have been tested using another tool to get the styles I would like.

 

Everything I have read seems that SLD files are supported but there are configuration changes to be made (providers.fac file?).  Is there something to do with portraying the WMS?  The documentation mentions these but really does not have a decent workflow describing how to set up.

 

Does someone have a workflow that would be able to take advantage of the SLD files with the WMS?  Is it a configurable thing?  Can the GetCapablilites be edited to include these SLD files?

 

Thanks for any help,

Tom

Moderator
Moderator
Posts: 276
Registered: ‎11-16-2015

Re: Workflow to use SLD files with WMS

Hi Tom,

 

You can define styles with SLD for the legacy services just by copying the SLD file in: C:\Program Files\Hexagon\ERDAS APOLLO\config\erdas-apollo\rendering. This is organized by service and then by layer.

To create a new style "style1" for a layer "layer1" in the service "myService", create the folowing directories:

"\myService\collection\layer1\style1"

Paste your SLD there and rename it "SVG.sld".

Then, restart the provider (use the Data Manager or simply: http://myAPOLLO/erdas-apollo/coverage/myService?request=debug&cmd=init,cache,flush).

You can also use the Data Manager, create a new style for a legacy serice and see what happens in C:\Program Files\Hexagon\ERDAS APOLLO\config\erdas-apollo\rendering.

 

The legacy services support also the SLD within the getMap request ("sld" and "sld_body" parameters).

 

Florent

New Contributor
Posts: 4
Registered: ‎03-13-2018

Re: Workflow to use SLD files with WMS

[ Edited ]

Hello Florent, thanks for the help with this.  I have followed your workflow and still don't seem to be getting the SLD file to show the correct styles.

 

This is what I've done.

 

I created the folder structure as you described as follows:

X:\APOLLO_SHARED_FILES\config\erdas-apollo\rendering\runway_2\collection\runway_2\defaultstyle 

 

I added an SLD file into there and renamed it SVG.sld.  I flushed the cache and restarted the service and nothing is showing. 

 

If I rename the first runway_2 folder so that that path is not being used, I get the runways with default styles to show up. 

 

The SLD file is pretty simple to fill a polygon with a stroke colour and width.  It's also as follows:

 

<?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" 
xmlnsSmiley Surprisedgc="http://www.opengis.net/ogc" 
xmlns:xlink="http://www.w3.org/1999/xlink" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<NamedLayer>
<Name>Simple polygon with stroke</Name>
<UserStyle>
<Title>SLD Cook Book: Simple polygon with stroke</Title>
<FeatureTypeStyle>

<Rule>
<PolygonSymbolizer>
<Fill>
<CssParameter name="fill">#e0e0e0</CssParameter>
</Fill>
<Stroke>
<CssParameter name="stroke">#919191</CssParameter>
<CssParameter name="stroke-width">2</CssParameter>
</Stroke>
</PolygonSymbolizer>
</Rule>
</FeatureTypeStyle>

</UserStyle>
</NamedLayer>
</StyledLayerDescriptor>

 

Any thoughts?

 

Thanks again,
Tom

Staff
Posts: 125
Registered: ‎05-31-2016

Re: Workflow to use SLD files with WMS

I believe the SLD files need to go into your Apollo installation (APOLLO_INSTALL_FOLDER\config\erdas-apollo\rendering), not in a different folder.

I have never done it so I dont know if it would work, but I guess you could change the location of the rendering folder by manually editing the providers.fac file for your service to point to the new style location.

 

The default location is here

C:\Program Files\Hexagon\ERDAS APOLLO\config\erdas-apollo\rendering

 

not

X:\APOLLO_SHARED_FILES\config\erdas-apollo\rendering

 

 

Regards,

Phil

 

 

Moderator
Moderator
Posts: 276
Registered: ‎11-16-2015

Re: Workflow to use SLD files with WMS

[ Edited ]

Hi Tom,

 

For a vector service, it is like "\myService\collection\feature1\defaultstyle". Is "runway_2" also a feature name?

Or maybe your SLD is not valid or APOLLO can't interpret it.

Another way of defining styles for legacy vector services is to use the proprietary styles ".prop". You can create them using the Style Editor: C:\Program Files\Hexagon\ERDAS APOLLO\tools\styleeditor\styleeditor.bat

Add your vector service: Data > Add Data source

Create your style

Deploy the style: File > Styles > Deploy to Directory

https://hexagongeospatial.fluidtopics.net/reader/GnhUWdGwEimDnas8OgXLDQ/7SE4zGeZE2KFBbspI~Ppuw

 

Moderator
Moderator
Posts: 276
Registered: ‎11-16-2015

Re: Workflow to use SLD files with WMS

[ Edited ]

I could make your SLD work by specifying the feature to apply the style (line 13):

 

<?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>Simple polygon</Name>
		<UserStyle>
			<Title>SLD Cook Book: Simple polygon</Title>
			<FeatureTypeStyle>
			<FeatureTypeName>myFeature</FeatureTypeName>
				<Rule>
					<PolygonSymbolizer>
						<Fill>
							<CssParameter name="fill">#000080</CssParameter>
						</Fill>
					</PolygonSymbolizer>
				</Rule>
			</FeatureTypeStyle>
		</UserStyle>
	</NamedLayer>
</StyledLayerDescriptor>

 

 

New Contributor
Posts: 4
Registered: ‎03-13-2018

Re: Workflow to use SLD files with WMS

Hello Florent,

 

This worked, thank you...but...for the polygons.  I also have some linear roads that need to be styled as well.  I tried the same approach using the <FeatureTypeName> again and nothing shows.

 

Here is the SLD file that I am trying to apply.  It's a simple line with colour and width.

 

<?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"
xmlnsSmiley Surprisedgc="http://www.opengis.net/ogc"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<NamedLayer>
<Name>Simple Line</Name>
<UserStyle>
<Title>SLD Cook Book: Simple Line</Title>
<FeatureTypeStyle>
<FeatureTypeName>roads_1_lines</FeatureTypeName>
<Rule>
<LineSymbolizer>
<Stroke>
<CssParameter name="stroke">#4286f4</CssParameter>
<CssParameter name="stroke-width">3</CssParameter>
</Stroke>
</LineSymbolizer>
</Rule>
</FeatureTypeStyle>
</UserStyle>
</NamedLayer>
</StyledLayerDescriptor>

 

The lines are showing with a default colour and width when I don't have anything in the rendering folder for this service.  Once I set up the path as described before, nothing shows up.

 

Here is the path that I have set up:

X:\APOLLO_SHARED_FILES\config\erdas-apollo\rendering\roads_1_lines\collection\roads_1_lines\defaultstyle

 

To answer another user, the providers.fac file had already been updated to X:\APOLLO_SHARED_FILES\config\erdas-apollo\rendering\ so this isn't the issue.

 

Any thoughts on my line issue??

 

Thanks,
Tom

 

New Contributor
Posts: 4
Registered: ‎03-13-2018

Re: Workflow to use SLD files with WMS

Hello again...

 

I have looked into this a little bit more and I don't think it has to do with the feature type.

 

I have already explained the road (linear) issue.  I am having the same problem with a polygon feature as well (lakes, rivers).  I'm wondering if it has to do with the complexity or size of the features themselves.

 

The original feature (runway - polygon) was a fairly small file and worked with the method we've already discussed.  When I try the exact method for the more complex features, they do not show up.  If I rename the folders in the rendering directory, they do show up with a default style.

 

Does this offer anything?  Any thoughts?


Thanks again,

Tom

Highlighted
Moderator
Moderator
Posts: 276
Registered: ‎11-16-2015

Re: Workflow to use SLD files with WMS

Maybe this is a product issue, I would suggest then to create a support ticket so the team can investigate.

 

But, have you tried the style editor? you can export the style and deploy it to the directory.

 

Florent

 

Do you need immediate support?
If you encounter a critical issue and need immediate assistance please submit a Service Request through our Support Portal.