热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

org.geotools.map.DefaultMapContext.()方法的使用及代码示例

本文整理了Java中org.geotools.map.DefaultMapContext.<init>()方法的一些代码示例,展示了Defaul

本文整理了Java中org.geotools.map.DefaultMapContext.()方法的一些代码示例,展示了DefaultMapContext.()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。DefaultMapContext.()方法的具体详情如下:
包路径:org.geotools.map.DefaultMapContext
类名称:DefaultMapContext
方法名:

DefaultMapContext.介绍

[英]Creates a default empty map context. The coordinate reference system for the map context should be set explicitly, or implicitly via addLayer prior to using the context.
[中]创建默认的空映射上下文。地图上下文的坐标参照系应在使用上下文之前通过addLayer显式或隐式设置。

代码示例

代码示例来源:origin: geotools/geotools

@Test
public void testDispose() {
DefaultMapContext mapCOntext= new DefaultMapContext();
mapContext.dispose();
mapCOntext= new DefaultMapContext(DefaultGeographicCRS.WGS84);
mapContext.dispose();
}

代码示例来源:origin: geotools/geotools

@Override
protected void setUp() throws Exception {
// setup data
File property = new File(TestData.getResource(this, "square.properties").toURI());
PropertyDataStore ds = new PropertyDataStore(property.getParentFile());
squareFS = ds.getFeatureSource("square");
bounds = new ReferencedEnvelope(0, 10, 0, 10, DefaultGeographicCRS.WGS84);
renderer = new StreamingRenderer();
cOntext= new DefaultMapContext(DefaultGeographicCRS.WGS84);
renderer.setContext(context);
Map hints = new HashMap();
hints.put("maxFiltersToSendToDatastore", 2);
hints.put("optimizedDataLoadingEnabled", true);
renderer.setRendererHints(hints);
// System.setProperty("org.geotools.test.interactive", "true");
}

代码示例来源:origin: geotools/geotools

public void testPartialLineLabelTrue() throws Exception {
// System.setProperty("java.awt.headless", "false");
Thread.sleep(1000);
Style style = RendererBaseTest.loadStyle(this, "partialLineLabelTrue.sld");
DefaultMapContext mc = new DefaultMapContext(DefaultGeographicCRS.WGS84);
mc.addLayer(fs_line, style);
renderer.setContext(mc);
final BufferedImage image = RendererBaseTest.renderImage(renderer, bounds, null);
// RenderedImageBrowser.showChain(image);
RendererBaseTest.assertPixel(image, 150, 1, Color.BLACK, 30);
}

代码示例来源:origin: geotools/geotools

public void testLabelLineOrientation() throws Exception {
Style style = RendererBaseTest.loadStyle(this, "textLineOrientation.sld");
DefaultMapContext mc = new DefaultMapContext(DefaultGeographicCRS.WGS84);
mc.addLayer(fs, style);
renderer.setContext(mc);
RendererBaseTest.showRender("Lines with circl stroke", renderer, TIME, bounds);
}
}

代码示例来源:origin: geotools/geotools

public void testPartialPointLabelNo() throws Exception {
// System.setProperty("java.awt.headless", "false");
Thread.sleep(1000);
Style style = RendererBaseTest.loadStyle(this, "partialPointLabelNo.sld");
DefaultMapContext mc = new DefaultMapContext(DefaultGeographicCRS.WGS84);
mc.addLayer(fs_point, style);
renderer.setContext(mc);
final BufferedImage image = RendererBaseTest.renderImage(renderer, bounds, null);
RendererBaseTest.assertPixel(image, 282, 152, Color.WHITE);
// Write to file
// ImageIO.write(image, "png", new File("C:/Temp/testPartialPointLabelNo.png"));
// Interactive visualization
// PartialsTest.showImage("Point Partials:No", TIME, image);
}

代码示例来源:origin: geotools/geotools

public void testPartialAreaLabelNo() throws Exception {
// System.setProperty("java.awt.headless", "false");
Thread.sleep(1000);
Style style = RendererBaseTest.loadStyle(this, "partialAreaLabelNo.sld");
DefaultMapContext mc = new DefaultMapContext(DefaultGeographicCRS.WGS84);
mc.addLayer(fs_area, style);
renderer.setContext(mc);
final BufferedImage image = RendererBaseTest.renderImage(renderer, bounds, null);
RendererBaseTest.assertPixel(image, 282, 152, Color.WHITE);
// Write to file
// ImageIO.write(image, "png", new File("C:/Temp/testPartialAreaLabelNo.png"));
// Interactive visualization
// PartialsTest.showImage("Area Partials:No", TIME, image);
}

代码示例来源:origin: geotools/geotools

public void testPartialAreaLabelFalse() throws Exception {
// System.setProperty("java.awt.headless", "false");
Thread.sleep(1000);
Style style = RendererBaseTest.loadStyle(this, "partialAreaLabelFalse.sld");
DefaultMapContext mc = new DefaultMapContext(DefaultGeographicCRS.WGS84);
mc.addLayer(fs_area, style);
renderer.setContext(mc);
final BufferedImage image = RendererBaseTest.renderImage(renderer, bounds, null);
RendererBaseTest.assertPixel(image, 282, 152, Color.WHITE);
// Write to file
// ImageIO.write(image, "png", new File("C:/Temp/testPartialAreaLabelFalse.png"));
// Interactive visualization
// PartialsTest.showImage("Area Partials:False", TIME, image);
}

代码示例来源:origin: geotools/geotools

public void testPointLabelFalse() throws Exception {
// System.setProperty("java.awt.headless", "false");
Thread.sleep(1000);
Style style = RendererBaseTest.loadStyle(this, "partialPointLabelFalse.sld");
DefaultMapContext mc = new DefaultMapContext(DefaultGeographicCRS.WGS84);
mc.addLayer(fs_point, style);
renderer.setContext(mc);
final BufferedImage image = RendererBaseTest.renderImage(renderer, bounds, null);
RendererBaseTest.assertPixel(image, 282, 152, Color.WHITE);
// Write to file
// ImageIO.write(image, "png", new File("C:/Temp/testPartialPointLabelFalse.png"));
// Interactive visualization
// PartialsTest.showImage("Point Partials:False", TIME, image);
}

代码示例来源:origin: geotools/geotools

public void testLabelNatural() throws Exception {
Style style = RendererBaseTest.loadStyle(this, "textNaturalOrientation.sld");
DefaultMapContext mc = new DefaultMapContext(DefaultGeographicCRS.WGS84);
mc.addLayer(fs, style);
renderer.setContext(mc);
RendererBaseTest.showRender("Lines with circle stroke", renderer, TIME, bounds);
}

代码示例来源:origin: geotools/geotools

public void testPartialPointLabelTrue() throws Exception {
// System.setProperty("java.awt.headless", "false");
Thread.sleep(1000);
Style style = RendererBaseTest.loadStyle(this, "partialPointLabelTrue.sld");
DefaultMapContext mc = new DefaultMapContext(DefaultGeographicCRS.WGS84);
mc.addLayer(fs_point, style);
renderer.setContext(mc);
final BufferedImage image = RendererBaseTest.renderImage(renderer, bounds, null);
RendererBaseTest.assertPixel(image, 282, 152, Color.BLACK);
// Write to file
// ImageIO.write(image, "png", new File("C:/Temp/testPartialPointLabelTrue.png"));
// Interactive visualization
// PartialsTest.showImage("Point Partials:True", TIME, image);
}

代码示例来源:origin: geotools/geotools

public void testPartialLineLabelNo() throws Exception {
// System.setProperty("java.awt.headless", "false");
Thread.sleep(1000);
Style style = RendererBaseTest.loadStyle(this, "partialLineLabelNo.sld");
DefaultMapContext mc = new DefaultMapContext(DefaultGeographicCRS.WGS84);
mc.addLayer(fs_line, style);
renderer.setContext(mc);
final BufferedImage image = RendererBaseTest.renderImage(renderer, bounds, null);
RendererBaseTest.assertPixel(image, 282, 155, Color.WHITE);
// Write to file
// ImageIO.write(image, "png", new File("C:/Temp/testPartialLineLabelNo.png"));
// Interactive visualization
// PartialsTest.showImage("Line Partials:No", TIME, image);
}

代码示例来源:origin: geotools/geotools

public void testPartialLineLabelFalse() throws Exception {
// System.setProperty("java.awt.headless", "false");
Thread.sleep(1000);
Style style = RendererBaseTest.loadStyle(this, "partialLineLabelFalse.sld");
DefaultMapContext mc = new DefaultMapContext(DefaultGeographicCRS.WGS84);
mc.addLayer(fs_line, style);
renderer.setContext(mc);
final BufferedImage image = RendererBaseTest.renderImage(renderer, bounds, null);
RendererBaseTest.assertPixel(image, 282, 155, Color.WHITE);
// Write to file
// ImageIO.write(image, "png", new File("C:/Temp/testPartialLineLabelFalse.png"));
// Interactive visualization
// PartialsTest.showImage("Line Partials:False", TIME, image);
}

代码示例来源:origin: geotools/geotools

public void testPartialAreaLabelTrue() throws Exception {
// System.setProperty("java.awt.headless", "false");
Thread.sleep(1000);
Style style = RendererBaseTest.loadStyle(this, "partialAreaLabelTrue.sld");
DefaultMapContext mc = new DefaultMapContext(DefaultGeographicCRS.WGS84);
mc.addLayer(fs_area, style);
renderer.setContext(mc);
final BufferedImage image = RendererBaseTest.renderImage(renderer, bounds, null);
RendererBaseTest.assertPixel(image, 282, 152, Color.BLACK);
// Write to file
// ImageIO.write(image, "png", new File("C:/Temp/testPartialAreaLabelTrue.png"));
// Interactive visualization
// PartialsTest.showImage("Area Partials:True", TIME, image);
}

代码示例来源:origin: geotools/geotools

@Test
public void testIsometric() throws Exception {
Style style = RendererBaseTest.loadStyle(this, "isometric.sld");
DefaultMapContext mc = new DefaultMapContext(DefaultGeographicCRS.WGS84);
mc.addLayer(bfs, style);
StreamingRenderer renderer = new StreamingRenderer();
renderer.setContext(mc);
renderer.setJava2DHints(new RenderingHints(KEY_ANTIALIASING, VALUE_ANTIALIAS_ON));
RendererBaseTest.showRender("lineStartEnd.sld", renderer, TIME, bbounds);
}

代码示例来源:origin: geotools/geotools

public void testDefaultLabelCache() throws Exception {
Style pStyle = RendererBaseTest.loadStyle(this, "textAnchorRotation.sld");
Style lStyle = RendererBaseTest.loadStyle(this, "lineGray.sld");
DefaultMapContext mc = new DefaultMapContext(DefaultGeographicCRS.WGS84);
mc.addLayer(lineFS, lStyle);
mc.addLayer(pointFS, pStyle);
StreamingRenderer renderer = new StreamingRenderer();
renderer.setContext(mc);
renderer.setJava2DHints(new RenderingHints(KEY_ANTIALIASING, VALUE_ANTIALIAS_ON));
RendererBaseTest.showRender("Old labeller", renderer, TIME, bounds);
}

代码示例来源:origin: geotools/geotools

@Test
public void testStartEnd() throws Exception {
Style style = RendererBaseTest.loadStyle(this, "lineStartEnd.sld");
DefaultMapContext mc = new DefaultMapContext(DefaultGeographicCRS.WGS84);
mc.addLayer(fs, style);
StreamingRenderer renderer = new StreamingRenderer();
renderer.setContext(mc);
RendererBaseTest.showRender("lineStartEnd.sld", renderer, TIME, bounds);
}

代码示例来源:origin: geotools/geotools

@Test
public void testBufferLine() throws Exception {
Style style = RendererBaseTest.loadStyle(this, "lineBuffer.sld");
DefaultMapContext mc = new DefaultMapContext(DefaultGeographicCRS.WGS84);
mc.addLayer(fs, style);
StreamingRenderer renderer = new StreamingRenderer();
renderer.setContext(mc);
RendererBaseTest.showRender("lineBuffer.sld", renderer, TIME, bounds);
}

代码示例来源:origin: geotools/geotools

@Test
public void testBufferPoly() throws Exception {
Style style = RendererBaseTest.loadStyle(this, "polyBuffer.sld");
DefaultMapContext mc = new DefaultMapContext(DefaultGeographicCRS.WGS84);
mc.addLayer(bfs, style);
StreamingRenderer renderer = new StreamingRenderer();
renderer.setContext(mc);
RendererBaseTest.showRender("polyBuffer.sld", renderer, TIME, bounds);
}

代码示例来源:origin: geotools/geotools

@Test
public void testVertices() throws Exception {
Style style = RendererBaseTest.loadStyle(this, "lineVertices.sld");
DefaultMapContext mc = new DefaultMapContext(DefaultGeographicCRS.WGS84);
mc.addLayer(fs, style);
StreamingRenderer renderer = new StreamingRenderer();
renderer.setContext(mc);
RendererBaseTest.showRender("lineVertices.sld", renderer, TIME, bounds);
}

代码示例来源:origin: geotools/geotools

public void testLessFilters() throws Exception {
Style style = RendererBaseTest.loadStyle(this, "fillSolidTwoRules.sld");
DefaultMapContext mc = new DefaultMapContext(DefaultGeographicCRS.WGS84);
mc.addLayer(squareFS, style);
renderer.setContext(mc);
renderer.addRenderListener(
new RenderListener() {
public void featureRenderer(SimpleFeature feature) {
count++;
}
public void errorOccurred(Exception e) {}
});
RendererBaseTest.showRender("OneSquare", renderer, TIME, bounds);
assertEquals(2, count);
}
}

推荐阅读
  • 本文将详细探讨 Java 中提供的不可变集合(如 `Collections.unmodifiableXXX`)和同步集合(如 `Collections.synchronizedXXX`)的实现原理及使用方法,帮助开发者更好地理解和应用这些工具。 ... [详细]
  • 深入解析Java枚举及其高级特性
    本文详细介绍了Java枚举的概念、语法、使用规则和应用场景,并探讨了其在实际编程中的高级应用。所有相关内容已收录于GitHub仓库[JavaLearningmanual](https://github.com/Ziphtracks/JavaLearningmanual),欢迎Star并持续关注。 ... [详细]
  • 本文详细介绍了 org.apache.commons.io.IOCase 类中的 checkCompareTo() 方法,通过多个代码示例展示其在不同场景下的使用方法。 ... [详细]
  • 对象自省自省在计算机编程领域里,是指在运行时判断一个对象的类型和能力。dir能够返回一个列表,列举了一个对象所拥有的属性和方法。my_list[ ... [详细]
  • 本文介绍如何使用 Android 的 Canvas 和 View 组件创建一个简单的绘图板应用程序,支持触摸绘画和保存图片功能。 ... [详细]
  • 在软件开发过程中,MD5加密是一种常见的数据保护手段。本文将详细介绍如何在C#中使用两种不同的方式来实现MD5加密:字符串加密和流加密。 ... [详细]
  • 使用lambda表达式排序Collections.sort(temp,(Stringa,Stringb)-{returnb.compareTo(a);});Collections ... [详细]
  • 本文作者分享了在阿里巴巴获得实习offer的经历,包括五轮面试的详细内容和经验总结。其中四轮为技术面试,一轮为HR面试,涵盖了大量的Java技术和项目实践经验。 ... [详细]
  • 异常要理解Java异常处理是如何工作的,需要掌握一下三种异常类型:检查性异常:最具代表性的检查性异常是用户错误或问题引起的异常ÿ ... [详细]
  • 本文介绍如何在Spring Boot项目中集成Redis,并通过具体案例展示其配置和使用方法。包括添加依赖、配置连接信息、自定义序列化方式以及实现仓储接口。 ... [详细]
  • Nginx 反向代理与负载均衡实验
    本实验旨在通过配置 Nginx 实现反向代理和负载均衡,确保从北京本地代理服务器访问上海的 Web 服务器时,能够依次显示红、黄、绿三种颜色页面以验证负载均衡效果。 ... [详细]
  • 主板IO用W83627THG,用VC如何取得CPU温度,系统温度,CPU风扇转速,VBat的电压. ... [详细]
  • 历经三十年的开发,Mathematica 已成为技术计算领域的标杆,为全球的技术创新者、教育工作者、学生及其他用户提供了一个领先的计算平台。最新版本 Mathematica 12.3.1 增加了多项核心语言、数学计算、可视化和图形处理的新功能。 ... [详细]
  • 深入解析ESFramework中的AgileTcp组件
    本文详细介绍了ESFramework框架中AgileTcp组件的设计与实现。AgileTcp是ESFramework提供的ITcp接口的高效实现,旨在优化TCP通信的性能和结构清晰度。 ... [详细]
  • 在编译BSP包过程中,遇到了一个与 'gets' 函数相关的编译错误。该问题通常发生在较新的编译环境中,由于 'gets' 函数已被弃用并视为安全漏洞。本文将详细介绍如何通过修改源代码和配置文件来解决这一问题。 ... [详细]
author-avatar
能然然520
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有