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
Contributor
Posts: 24
Registered: ‎05-11-2017

How to define scale ranges for WMS/WFS

Hi all,

 

I am using Apollo Advantage 2018 and I have created a few vector services.

I am using Vector Service Style Editor for data styling.

 

Is there any way to define scale ranges for layers in service?

In Style Editor there is part related to scale ranges, but scale ranges defined there are applied only to map window in Style Editor.

 

Regards,

Micko

 

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

Re: How to define scale ranges for WMS/WFS

I add scale ranges by adding MapGen sections to my Mapping file.

Here is a link to the documentation https://hexagongeospatial.fluidtopics.net/reader/JmIvzN0qCQzgtWYtOP2PvQ/rHJB40vI1oLBm_6b5z0CZA

 

Example from the documentation:

 

<Mapping>
 <SQL name="wfs:CITY">
  <Primary name="ID" nameSQL="ID" />
  [...]
  <Element name="ADMIN_LEVEL" nameSQL="LEVEL" />
  <Element name="POPULATION" nameSQL="POP" />
  <Element name="ECOSTAT" nameSQL="STAT" />
  <Element name="Boundary" nameSQL="BOUNDARY" />
  <!-- another geometric column exists, named CENTER, for the city center point -->

  <MapGen scaleMin="1000000">
   <Field name="Boundary">CENTER</Field/>
   <Where>ADMIN_LEVEL>4</Where>
  </MapGen>

  <MapGen scaleMax="1000000" scaleMin="100000">
   <Field name="Boundary"/>
   <Where>ADMIN_LEVEL=4</Where>
  </MapGen>

  <MapGen scaleMax="100000">
   <Field name="Boundary"/>
   <Where>ADMIN_LEVEL<4</Where>
  </MapGen>

 </SQL>
<Mapping>
Staff
Posts: 125
Registered: ‎05-31-2016

Re: How to define scale ranges for WMS/WFS

And if you want to set style scale ranges on data using the data manager style editor you just create the styles and set the Displayable value to use an expression.

Something like 

IF(DISPLAYSCALE()<300000, TRUE(), FALSE())

 

Capture.JPG

Contributor
Posts: 24
Registered: ‎05-11-2017

Re: How to define scale ranges for WMS/WFS

Hi phudson,

 

Thanks a lot for tips.

First option works well. It's not exactly what I thought, but it works.

 

I have parcels for complete region and I wanted to limit display scale up to 15000 and for smaller scale to provide information that data is not available in current scale.

 

With MapGen I allowed to display only big parcels .

 

	  <MapGen scaleMin="1" scaleMax="15000" >
	  <Field name="geom"/>
	  </MapGen>
	  
	  <MapGen scaleMin="15001" scaleMax="30000" >
	  <Field name="area"/>
	  <Field name="geom"/>
	  <Where>area>75000</Where>
	  </MapGen>

	  <MapGen scaleMin="30001" scaleMax="1000000000" >
	  <Field name="area"/>
	  <Field name="geom"/>
	  <Where>area>300000</Where>
	  </MapGen>

 

It is not posssible to use tip from your second message. For vector services it is not possible to open data manager style editor to add or edit styles.

addstyle.PNG

Regards

 

 

Contributor
Posts: 24
Registered: ‎05-11-2017

Re: How to define scale ranges for WMS/WFS

Hi all,

 

Is there any way to limit scale completely  and provide some information to user wheh he load data that layer is not visible in current scale?

 

Regards,

Micko

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

Re: How to define scale ranges for WMS/WFS

Yes there are 2 different ways to serve vector services from Apollo.

1. The Legacy way like you have shown in your screen shot (added to the Vector services list in the Data Manager). This will serve WFS/WMS

2. The other way is when you crawl a database, shape file, etc to add it to your Catalog. This is WMS only.

 

These 2 different vector services are styled differently.

1. The first way you can configure scale hints by setting MapGen Scale min and scale max and styles are added using the legacy style editor found here "C:\Program Files\Hexagon\ERDAS APOLLO\tools\styleeditor"

 

2. The second way the scale and style is set by right clicking the data set in the Data Manager and selecting edit raster styles.

Contributor
Posts: 24
Registered: ‎05-11-2017

Re: How to define scale ranges for WMS/WFS

Hi Pudson,

 

I am using MapGen Scale min and scale max but it is not exactly what I want.

I used area atribute in my parcels and I filter what is showing based on that. It looks like following

 

	  <MapGen scaleMin="1" scaleMax="15000" >
	  <Field name="geom"/>
	  </MapGen>
	  
	  <MapGen scaleMin="15001" scaleMax="30000" >
	  <Field name="Area"/>
	  <Field name="geom"/>
	  <Where>Area>75000</Where>
	  </MapGen>

	  <MapGen scaleMin="30001" scaleMax="1000000000" >
	  <Field name="Area"/>
	  <Field name="geom"/>
	  <Where>Area>300000</Where>
	  </MapGen>

 

Problem with this is that When I open map in Geospatial Portal for example and when I zoom to whole country there is no information that parcel layer is not visible in curent scale.

 

Is there way to add this info to layer somehow? With MapGen or within Style Editor.

 

Micko

 

 

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

Re: How to define scale ranges for WMS/WFS

I am not sure how the portal determines if a layer is within the current scale.

 

Check the BoundingBox for the service in the generatedMaping.xml file, make sure it only covers the area that has data, not the whole world

 

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

Re: How to define scale ranges for WMS/WFS

Hi Phil,

 

The Portal checks the getCapabilities if the min and max scales are set:

getcapa.png

 

You have the same when you specify a Scale Limit in the Core Console (only raster).

 

If you want to do the same with a vector service, you need to:

  • create a vector service (Data Manager)
  • create a style if needed using the Style Editor and deploy it to the directories
  • create a new project in the Style Editor, add the desired vector layers in WMS (to use styles just created) and set the min/max scales
  • export the project in a Context file (XML)
  • Create a Context service (WMC, Data Manager) using the context file (Maps & Proxies, Advanced Data source type)

context.png

 

dm.png

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

Re: How to define scale ranges for WMS/WFS

You have quite the same possibility with a simpler workflow by specifying the min/max scale within a SLD style (SVG.sld in the deployed style directory). It works but unfortunately the min/max scales are not exposed in the getCapabilities.

 

<?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>xxx</Name>
		<Title>xxx</Title>
		<UserStyle>
			<FeatureTypeStyle>
				<FeatureTypeName>Zoning</FeatureTypeName>
				<Rule>
					<MinScaleDenominator>1960.6725259051457</MinScaleDenominator>
					<MaxScaleDenominator>271754.7946364207</MaxScaleDenominator>
					<PolygonSymbolizer>
						<Fill>
							<CssParameter name="fill">#000080</CssParameter>
						</Fill>
						<Stroke>
							<CssParameter name="stroke">#FFFFFF</CssParameter>
							<CssParameter name="stroke-width">2</CssParameter>
						</Stroke>
					</PolygonSymbolizer>
				</Rule>
			</FeatureTypeStyle>
		</UserStyle>
	</NamedLayer>
</StyledLayerDescriptor>
Do you need immediate support?
If you encounter a critical issue and need immediate assistance please submit a Service Request through our Support Portal.