문제

I'm sorry to ask a question here. I'm new to geotools. Now I need a function to output features into a tile. Function is defined as follows:

public Image getTile(FeatureCollection features,Style style,double minX,double minY,double maxX,double maxY,double resolution){

    return ;
}

Can someone give me some sample code or advice? Thanks in advance.

도움이 되었습니까?

해결책

Basically you'll need to generate an Image that is the right size and pass it's graphic2D to the renderer in the same way that any other rendering is done. So you'll need to calculate the bounding box and call GTRenderer.paint().

There is a whole bunch of other stuff you'll really want to consider like metatiling, label caching etc.

You may well find looking at GeoWebCache useful either to create your tiles or at least to give you some clues as to how to proceed.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top