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

推荐阅读
  • 本文介绍了Swing组件的用法,重点讲解了图标接口的定义和创建方法。图标接口用来将图标与各种组件相关联,可以是简单的绘画或使用磁盘上的GIF格式图像。文章详细介绍了图标接口的属性和绘制方法,并给出了一个菱形图标的实现示例。该示例可以配置图标的尺寸、颜色和填充状态。 ... [详细]
  • Java太阳系小游戏分析和源码详解
    本文介绍了一个基于Java的太阳系小游戏的分析和源码详解。通过对面向对象的知识的学习和实践,作者实现了太阳系各行星绕太阳转的效果。文章详细介绍了游戏的设计思路和源码结构,包括工具类、常量、图片加载、面板等。通过这个小游戏的制作,读者可以巩固和应用所学的知识,如类的继承、方法的重载与重写、多态和封装等。 ... [详细]
  • SpringBoot uri统一权限管理的实现方法及步骤详解
    本文详细介绍了SpringBoot中实现uri统一权限管理的方法,包括表结构定义、自动统计URI并自动删除脏数据、程序启动加载等步骤。通过该方法可以提高系统的安全性,实现对系统任意接口的权限拦截验证。 ... [详细]
  • Java学习笔记之面向对象编程(OOP)
    本文介绍了Java学习笔记中的面向对象编程(OOP)内容,包括OOP的三大特性(封装、继承、多态)和五大原则(单一职责原则、开放封闭原则、里式替换原则、依赖倒置原则)。通过学习OOP,可以提高代码复用性、拓展性和安全性。 ... [详细]
  • 开发笔记:实验7的文件读写操作
    本文介绍了使用C++的ofstream和ifstream类进行文件读写操作的方法,包括创建文件、写入文件和读取文件的过程。同时还介绍了如何判断文件是否成功打开和关闭文件的方法。通过本文的学习,读者可以了解如何在C++中进行文件读写操作。 ... [详细]
  • 先看官方文档TheJavaTutorialshavebeenwrittenforJDK8.Examplesandpracticesdescribedinthispagedontta ... [详细]
  • 基于Socket的多个客户端之间的聊天功能实现方法
    本文介绍了基于Socket的多个客户端之间实现聊天功能的方法,包括服务器端的实现和客户端的实现。服务器端通过每个用户的输出流向特定用户发送消息,而客户端通过输入流接收消息。同时,还介绍了相关的实体类和Socket的基本概念。 ... [详细]
  • ***byte(字节)根据长度转成kb(千字节)和mb(兆字节)**parambytes*return*publicstaticStringbytes2kb(longbytes){ ... [详细]
  • OpenMap教程4 – 图层概述
    本文介绍了OpenMap教程4中关于地图图层的内容,包括将ShapeLayer添加到MapBean中的方法,OpenMap支持的图层类型以及使用BufferedLayer创建图像的MapBean。此外,还介绍了Layer背景标志的作用和OMGraphicHandlerLayer的基础层类。 ... [详细]
  • 向QTextEdit拖放文件的方法及实现步骤
    本文介绍了在使用QTextEdit时如何实现拖放文件的功能,包括相关的方法和实现步骤。通过重写dragEnterEvent和dropEvent函数,并结合QMimeData和QUrl等类,可以轻松实现向QTextEdit拖放文件的功能。详细的代码实现和说明可以参考本文提供的示例代码。 ... [详细]
  • CSS3选择器的使用方法详解,提高Web开发效率和精准度
    本文详细介绍了CSS3新增的选择器方法,包括属性选择器的使用。通过CSS3选择器,可以提高Web开发的效率和精准度,使得查找元素更加方便和快捷。同时,本文还对属性选择器的各种用法进行了详细解释,并给出了相应的代码示例。通过学习本文,读者可以更好地掌握CSS3选择器的使用方法,提升自己的Web开发能力。 ... [详细]
  • 本文介绍了九度OnlineJudge中的1002题目“Grading”的解决方法。该题目要求设计一个公平的评分过程,将每个考题分配给3个独立的专家,如果他们的评分不一致,则需要请一位裁判做出最终决定。文章详细描述了评分规则,并给出了解决该问题的程序。 ... [详细]
  • 本文介绍了Oracle数据库中tnsnames.ora文件的作用和配置方法。tnsnames.ora文件在数据库启动过程中会被读取,用于解析LOCAL_LISTENER,并且与侦听无关。文章还提供了配置LOCAL_LISTENER和1522端口的示例,并展示了listener.ora文件的内容。 ... [详细]
  • 本文详细介绍了git常用命令及其操作方法,包括查看、添加、提交、删除、找回等操作,以及如何重置修改文件、抛弃工作区修改、将工作文件提交到本地暂存区、从版本库中删除文件等。同时还介绍了如何从暂存区恢复到工作文件、恢复最近一次提交过的状态,以及如何合并多个操作等。 ... [详细]
  • Android工程师面试准备及设计模式使用场景
    本文介绍了Android工程师面试准备的经验,包括面试流程和重点准备内容。同时,还介绍了建造者模式的使用场景,以及在Android开发中的具体应用。 ... [详细]
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社区 版权所有