if( srs.startsWith( "EPSG" ) ) return srs; //$NON-NLS-1$
}
return "EPSG:4326"; //$NON-NLS-1$
}
private static void writeGeneral( IMap map, BufferedWriter out ) throws IOException {
IViewportModel view = map.getViewportModel();
int w = 640;
int h = (int) ( ((double)w) * view.getAspectRatio() );
Envelope bbox = view.getBounds();
CoordinateReferenceSystem crs = view.getCRS();
String user = System.getenv("user.name"); //$NON-NLS-1$
append( 2, out, "<General>"); //$NON-NLS-1$
append( 4, out, "<Window height=\""+h+"\" width=\""+w+"\"/>"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
append( 4, out, "<ows:BoundingBox crs=\""+srs( view.getCRS() )+ "\">" ); //$NON-NLS-1$ //$NON-NLS-2$
append( 6, out, "<ows:LowerCorner>"+bbox.getMinX()+" "+bbox.getMinY()+"</ows:LowerCorner>"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
append( 6, out, "<ows:UpperCorner>"+bbox.getMaxX()+" "+bbox.getMaxY()+"</ows:UpperCorner>"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
append( 4, out, "</ows:BoundingBox>"); //$NON-NLS-1$
append( 4, out, "<Title>"+map.getName()+"</Title>"); //$NON-NLS-1$ //$NON-NLS-2$
append( 4, out, "<ows:ServiceProvider>"); //$NON-NLS-1$