首页 / 浏览问题 / 组件GIS / 问题详情
java iobject 缓冲区分析异常
91EXP 2017年04月12日

我的代码:

                // 设置缓冲区分析参数
				BufferAnalystParameter bufferAnalystParam = new BufferAnalystParameter();
				bufferAnalystParam.setEndType(BufferEndType.FLAT);
				bufferAnalystParam.setLeftDistance(20);
				bufferAnalystParam.setRightDistance(20);
				
				GeoRegion region = null;
				Map<String, Object> value = new HashMap<String, Object>();
				value.put("RNO", dv.getName());
				while (!rs.isEOF()) {
					
					Geometry geom = rs.getGeometry();
					if (geom instanceof GeoRegion) {
						region = BufferAnalystGeometry.createBuffer(geom, bufferAnalystParam);

					} else if (geom instanceof GeoText) {
						GeoText text = (GeoText) geom;
						value.put("Name", text.getText());
					}
					geom.toString();
					rs.moveNext();
				}
				rsGridReg.addNew(region, value);

我的异常信息:

java.lang.IllegalArgumentException: geometry

    at com.supermap.analyst.spatialanalyst.BufferAnalystGeometry.createBuffer(Unknown Source) ~[com.supermap.data.jar:na]
    at com.supermap.analyst.spatialanalyst.BufferAnalystGeometry.createBuffer(Unknown Source) ~[com.supermap.data.jar:na]
    at com.khidi.reversoir.service.ReversoirService.initReservoirGridReg(ReversoirService.java:317) ~[classes/:na]
    at com.khidi.reversoir.web.ReversoirController.initReservoirGridReg(ReversoirController.java:19) ~[classes/:na]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_65]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_65]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_65]
    at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_65]
    at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205) ~[spring-web-4.3.7.RELEASE.jar:4.3.7.RELEASE]
    at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133) ~[spring-web-4.3.7.RELEASE.jar:4.3.7.RELEASE]
    at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:116) ~[spring-webmvc-4.3.7.RELEASE.jar:4.3.7.RELEASE]
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827) ~[spring-webmvc-4.3.7.RELEASE.jar:4.3.7.RELEASE]
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738) ~[spring-webmvc-4.3.7.RELEASE.jar:4.3.7.RELEASE]
    at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85) ~[spring-webmvc-4.3.7.RELEASE.jar:4.3.7.RELEASE]
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:963) ~[spring-webmvc-4.3.7.RELEASE.jar:4.3.7.RELEASE]
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897) ~[spring-webmvc-4.3.7.RELEASE.jar:4.3.7.RELEASE]
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970) ~[spring-webmvc-4.3.7.RELEASE.jar:4.3.7.RELEASE]
    at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861) ~[spring-webmvc-4.3.7.RELEASE.jar:4.3.7.RELEASE]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:622) ~[tomcat-embed-core-8.5.11.jar:8.5.11]
    at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) ~[spring-webmvc-4.3.7.RELEASE.jar:4.3.7.RELEASE]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) ~[tomcat-embed-core-8.5.11.jar:8.5.11]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230) ~[tomcat-embed-core-8.5.11.jar:8.5.11]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) ~[tomcat-embed-core-8.5.11.jar:8.5.11]
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) ~[tomcat-embed-websocket-8.5.11.jar:8.5.11]
 

请问是什么问题?怎么解决?谢谢。

1个回答

1.调试下看看geom对象的是否有值,以及类型,数据坐标单位是度还是米?

2.如果是面生成缓冲区的话,只能是圆头类型的端点。
1,560EXP 2017年04月12日
谢谢,就是圆头类型的问题,这个异常信息不多啊。
...