Nothing is jumping out at me right away. Maybe the style is somehow
crazy? Seems unlikely but possible. Could you send the style to us?
Jesse
Mark Presling wrote:
Hi. Sorry to bug the list again, but I have been trying to create my
own renderer based on BasicFeatureRenderer to render the features of a
WFS layer.
What I have done is this:
- Make a copy of BasicFeatureRenderer called
RoadEventFeatureRenderer. The only thing different at this stage is the
name and package
- Make a copy of BasicFeatureMetricsFactory called called
RoadEventFeatureMetricsFactory. The differences are the name/package,
what it returns in createMetrics() and and getRendererType() and a
check in canRender() that returns true only for a particular layer name
String layerName = context.getLayer().getName();
String layerName = context.getLayer().getName();if (context.getLayer() instanceof SelectionLayer && fs != null && "roadevent_pnt".equalsIgnoreCase(layerName)) {
System.err.println("RoadEventFeatureMetricsFactory returning true for " + layerName);
return true;
}
- Make a copy of BasicFeatureMetrics called called
RoadEventFeatureMetrics. Changed types to match those above.
- Modify BasicFeatureMetricsFactory to return false for the
particular layer identified above.
- Register my renderer with the extension point
net.refractions.udig.project.renderer in my plugin.xml
<extension
point="net.refractions.udig.project.renderer">
<renderer class="nz.govt.transit.callcenter.RoadEventFeatureMetricsFactory"/>
</extension>
- Run app.
What I find through debugging is that the renderer is called as
expected, but for some reason it is not outputting anything. Please
note that I have not modified the actual rendering code... it still
uses the StreamingRenderer as the existing one does.
I have noticed that the filter/queries that are set on the layer are
different to the ones set when using BasicFeatureRenderer. In BFR the
filter is:
Query: [Request All Features]
feature type: null
filter: Filter.NONE
[properties: ALL ]
but in mine it was Filter.ALL (which I believe means filter OUT
everything - return nothing). So I explicitly set the query to
Query.ALL in the setQueries() method of my BFR clone.
So, this meant that the feature collection returned in the
StreamingRenderer had 24 items in it now. Good. However, still nothing
is rendered and when you click on the layer it says "Layer not
rendered" in the status bar.
Another thing of concern is that on the console I see this:
Current Renderers:
CompositeRendererImpl
RenderExecutorImpl:BasicWMSRenderer2-highway
RenderExecutorImpl:BasicFeatureRenderer-nmcregion_poly
I have 1 WMS layer and 2 WFS layers - one of which I want to render
with my renderer. As you can see, my renderer doesn't appear in this
list, but it is definitely instantiated and the render method is
definitely called on it.
Is there something that I am missing in terms of extensions or classes
that I need to implement? My intention is to just implement a renderer,
not the whole stack of DataSource/FeatureSource/etc.
Thanks,
Mark
--
This message has been scanned for viruses and dangerous
content by MailScanner,
and is believed to be clean.
_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel
|
_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel