热门标签 | 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);
}
}

推荐阅读
  • ImmutableX Poised to Pioneer Web3 Gaming Revolution
    ImmutableX is set to spearhead the evolution of Web3 gaming, with its innovative technologies and strategic partnerships driving significant advancements in the industry. ... [详细]
  • 本文详细介绍了Java中org.neo4j.helpers.collection.Iterators.single()方法的功能、使用场景及代码示例,帮助开发者更好地理解和应用该方法。 ... [详细]
  • Explore how Matterverse is redefining the metaverse experience, creating immersive and meaningful virtual environments that foster genuine connections and economic opportunities. ... [详细]
  • 1.如何在运行状态查看源代码?查看函数的源代码,我们通常会使用IDE来完成。比如在PyCharm中,你可以Ctrl+鼠标点击进入函数的源代码。那如果没有IDE呢?当我们想使用一个函 ... [详细]
  • 本文详细介绍了 Dockerfile 的编写方法及其在网络配置中的应用,涵盖基础指令、镜像构建与发布流程,并深入探讨了 Docker 的默认网络、容器互联及自定义网络的实现。 ... [详细]
  • 本文详细介绍了Java中org.eclipse.ui.forms.widgets.ExpandableComposite类的addExpansionListener()方法,并提供了多个实际代码示例,帮助开发者更好地理解和使用该方法。这些示例来源于多个知名开源项目,具有很高的参考价值。 ... [详细]
  • 深入解析Spring Cloud Ribbon负载均衡机制
    本文详细介绍了Spring Cloud中的Ribbon组件如何实现服务调用的负载均衡。通过分析其工作原理、源码结构及配置方式,帮助读者理解Ribbon在分布式系统中的重要作用。 ... [详细]
  • 本文深入探讨了 Java 中的 Serializable 接口,解释了其实现机制、用途及注意事项,帮助开发者更好地理解和使用序列化功能。 ... [详细]
  • DNN Community 和 Professional 版本的主要差异
    本文详细解析了 DotNetNuke (DNN) 的两种主要版本:Community 和 Professional。通过对比两者的功能和附加组件,帮助用户选择最适合其需求的版本。 ... [详细]
  • 本文介绍如何使用阿里云的fastjson库解析包含时间戳、IP地址和参数等信息的JSON格式文本,并进行数据处理和保存。 ... [详细]
  • 本文详细介绍了 com.facebook.drawee.view.SimpleDraweeView 中的 setScaleType 方法,提供了多个实际代码示例,并解释了其在不同场景下的应用。 ... [详细]
  • 基于KVM的SRIOV直通配置及性能测试
    SRIOV介绍、VF直通配置,以及包转发率性能测试小慢哥的原创文章,欢迎转载目录?1.SRIOV介绍?2.环境说明?3.开启SRIOV?4.生成VF?5.VF ... [详细]
  • 本文详细介绍了如何使用 Yii2 的 GridView 组件在列表页面实现数据的直接编辑功能。通过具体的代码示例和步骤,帮助开发者快速掌握这一实用技巧。 ... [详细]
  • 本文深入探讨 MyBatis 中动态 SQL 的使用方法,包括 if/where、trim 自定义字符串截取规则、choose 分支选择、封装查询和修改条件的 where/set 标签、批量处理的 foreach 标签以及内置参数和 bind 的用法。 ... [详细]
  • 在前两篇文章中,我们探讨了 ControllerDescriptor 和 ActionDescriptor 这两个描述对象,分别对应控制器和操作方法。本文将基于 MVC3 源码进一步分析 ParameterDescriptor,即用于描述 Action 方法参数的对象,并详细介绍其工作原理。 ... [详细]
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社区 版权所有