标签: geoserver

臭名昭着的java.sql.SQLException:找不到合适的驱动程序

我正在尝试将已启用数据库的JSP添加到现有的Tomcat 5.5应用程序(GeoServer 2.0.0,如果有帮助的话).

该应用程序本身与Postgres谈话很好,所以我知道数据库已启动,用户可以访问它,所有这些好东西.我想要做的是在我添加的JSP中的数据库查询.我已经在Tomcat数据源示例中使用了配置示例,非常开箱即用.必要的taglibs位于正确的位置 - 如果我只有taglib refs就不会发生错误,因此它会找到那些JAR.postgres jdbc驱动程序postgresql-8.4.701.jdbc3.jar位于$ CATALINA_HOME/common/lib中.

这是JSP的顶部:

<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<sql:query var="rs" dataSource="jdbc/mmas">
  select current_validstart as ValidTime from runoff_forecast_valid_time
</sql:query>
Run Code Online (Sandbox Code Playgroud)

来自$ CATALINA_HOME/conf/server.xml的相关部分,其内部<Host>依次是<Engine>:

<Context path="/gs2" allowLinking="true">
  <Resource name="jdbc/mmas" type="javax.sql.Datasource"
      auth="Container" driverClassName="org.postgresql.Driver"
      maxActive="100" maxIdle="30" maxWait="10000"
      username="mmas" password="very_secure_yess_precious!"
      url="jdbc:postgresql//localhost:5432/mmas" />
</Context>
Run Code Online (Sandbox Code Playgroud)

这些行是webapps/gs2/WEB-INF/web.xml中标记的最后一行:

<resource-ref>
  <description>
     The database resource for the MMAS PostGIS database
  </description>
  <res-ref-name>
     jdbc/mmas
  </res-ref-name>
  <res-type>
     javax.sql.DataSource
  </res-type>
  <res-auth>
     Container
  </res-auth>
</resource-ref>
Run Code Online (Sandbox Code Playgroud)

最后,例外:

   exception
    org.apache.jasper.JasperException: Unable …
Run Code Online (Sandbox Code Playgroud)

postgresql tomcat jdbc geoserver

72
推荐指数
4
解决办法
12万
查看次数

CORS - Tomcat - Geoserver

所有,我试图在Tomcat 7.0.52上为Geoserver启用CORS.

我修改了tomcat中conf的web.xml,如 http://tomcat.apache.org/tomcat-7.0-doc/config/filter.html#CORS_Filter中所述

但是,这无助于在标题中设置交叉起源.我甚至尝试过geoserver web-inf/web.xml但没有帮助.

任何建议表示赞赏.

谢谢!

tomcat cross-domain geoserver cors tomcat7

21
推荐指数
2
解决办法
2万
查看次数

PostGIS - 将多面转换为单个多边形

是否可以在PostGIS中将包含多边形的形状文件导入单个多边形?每当我尝试导入多边形的形状文件时,它都会在geom列中存储为多面(而不是单个多边形).因此,我无法将其从多面体中提取为单个多边形值.

所有有用的建议非常感谢

postgresql postgis geoserver

19
推荐指数
2
解决办法
3万
查看次数

node.js和geoserver CORS

我有node.js服务器0.10.12和express.js 4.8.5.Node.js是Web服务器,包括openlayers 3.9.0.

Geoserver 2.1.3服务于WMS层.稍后,我将实现矢量图层.

只有一条路线(索引页面)

var routes = require('./routes/index');
Run Code Online (Sandbox Code Playgroud)

index.js包含

var express = require('express');
var router = express.Router();

router.get('/', function(req, res, next) {
  res.render('index', { title: 'openlayers3 testing', head: 'Welcome' });
  next();
});

module.exports = router;
Run Code Online (Sandbox Code Playgroud)

所以app.js有了

var routes = require('./routes/index');//explained above

var app = express();

// view engine setup
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'ejs');

app.use(favicon());
app.use(logger('dev'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded());
app.use(cookieParser());
app.use(express.static(path.join(__dirname, 'public')));
Run Code Online (Sandbox Code Playgroud)

我为CORS添加了以下内容

app.use(function (req, res, next) {
    res.setHeader('Access-Control-Allow-Origin', '*');
    res.setHeader('Access-Control-Allow-Methods', 'GET, POST, OPTIONS, …
Run Code Online (Sandbox Code Playgroud)

geoserver openlayers node.js express openlayers-3

13
推荐指数
1
解决办法
1512
查看次数

像OpenStreetMap一样显示地图

我喜欢OpenStreetMap显示地图的方式.它几乎看起来像谷歌地图.我已经在笔记本上安装了GeoServer和PostGis.我还为我的国家印度尼西亚提供了这个cloudmade osm文件.我下载了indonesia.osm.bz2.

我成功地将它导入我的PostGis并在我的GeoServer上设置了它,但它没有像OpenStreetMap那样显示地图.我选择了planet_osm_polygon作为GeoServer中的图层.最后,我用openlayers显示了这个. 替代文字http://deerawan.com/blogimages/map_polygon.jpg

但我希望像这样一个 alt文本http://deerawan.com/blogimages/map-indo.png

我从Cloudmade使用的OSM文件是错误的吗?

谢谢您的帮助.

postgis geoserver openlayers openstreetmap

12
推荐指数
2
解决办法
1万
查看次数

C#中使用C#进行用户身份验证

我想在c#中执行以下cURL请求:

curl -u admin:geoserver -v -XPOST -H 'Content-type: text/xml' \
   -d '<workspace><name>acme</name></workspace>' \
   http://localhost:8080/geoserver/rest/workspaces
Run Code Online (Sandbox Code Playgroud)

我尝试过使用WebRequest:

string url = "http://localhost:8080/geoserver/rest/workspaces";
WebRequest request = WebRequest.Create(url);

request.ContentType = "Content-type: text/xml";
request.Method = "POST";
request.Credentials = new NetworkCredential("admin", "geoserver");

byte[] buffer = Encoding.GetEncoding("UTF-8").GetBytes("<workspace><name>my_workspace</name></workspace>");
Stream reqstr = request.GetRequestStream();
reqstr.Write(buffer, 0, buffer.Length);
reqstr.Close();

WebResponse response = request.GetResponse();
...
Run Code Online (Sandbox Code Playgroud)

但是我收到一个错误:(400)请求不好.

如果我更改请求凭据并在标头中添加身份验证:

string url = "http://localhost:8080/geoserver/rest/workspaces";
WebRequest request = WebRequest.Create(url);

request.ContentType = "Content-type: text/xml";
request.Method = "POST";
string authInfo = "admin:geoserver";
request.Headers["Authorization"] = "Basic " + authInfo;

byte[] …
Run Code Online (Sandbox Code Playgroud)

.net c# authentication curl geoserver

11
推荐指数
2
解决办法
2万
查看次数

如何从geoserver获取图层列表

是否有可能获得geoserver服务的所有图层的列表?即是否有一些特定的URL请求发送这样做?

geoserver

10
推荐指数
1
解决办法
1万
查看次数

是否有任何真正的替代GeoServer作为Java中的动态地图生成器?

我正在寻找最适合用Java生成动态地理地图的工具(基于自定义业务数据的样式:颜色,标签等将动态设置).经过一些搜索,只有GeoServer(以及底层的GeoTools库)似乎适合.

虽然我对这个解决方案非常满意,但我担心我可能会错过一些东西并根据不完整的输入作出决定.有什么建议吗?有什么比较可行的可行方案吗?

java geoserver

8
推荐指数
1
解决办法
5116
查看次数

列名称的问题在PostgreSQL中包含冒号

我从OSM下载了形状数据.我已经将Shapefile中的数据导入PostgreSQL而没有任何问题,但是当我执行select语句时出现错误.

Select addr:city From location;

Error: syntax error at or near ":"
Run Code Online (Sandbox Code Playgroud)

问题是因为列名包含冒号.任何人都可以帮我解决这个问题吗?我应该在导入过程中拒绝这个shapefile吗?shapefile是否正常?

postgresql postgis geospatial shapefile geoserver

8
推荐指数
1
解决办法
3495
查看次数

在Android应用程序中使用GeoServer中的getTileURL

我们刚刚开始在Android上使用Google地图,并设置了GeoServer来提供我们想要在地图上添加为叠加层的切片.到目前为止,我已经学习了一些教程和参考资料.

问题:虽然我在getTileUrl函数中生成的url TileProviderFactory确实在我设置断点并将url复制并粘贴到浏览器时返回png图像,但它不会作为Android设备上的叠加层加载到地图上.有没有错误,从我所看到和阅读后,被抛出这个我不知道是否会有任何因为他们已经表示,正在静音的错误.

我想知道的是,如果您可以在我的代码中看到任何直接问题,或者有任何调试建议我将能够判断应用程序是否实际与我的GeoServer通信以检索图像.我查看了GeoServer上的日志,似乎只有我的浏览器请求正在通过,而且它没有收到来自Android的任何请求(这有点难以分辨,因为我们还有其他应用程序使用服务器).Android手机通过wifi和手机连接,并启用了GPS.作为最后的手段,我尝试更改瓷砖覆盖zIndex并将其设置为可见,但这似乎没有任何区别.

编辑:此时Android设备肯定不与GeoServer通信.

编辑2:能够从网站(如此)加载静态图像作为叠加层,并发现我在测试出形成的URL的HTTP请求时遇到以下异常:

W/System.err(10601): java.net.SocketException: The operation timed out
W/System.err(10601): at org.apache.harmony.luni.platform.OSNetworkSystem
     .connectStreamWithTimeoutSocketImpl(Native Method)
W/System.err(10601): at org.apache.harmony.luni.net.PlainSocketImpl
     .connect(PlainSocketImpl.java:244)
W/System.err(10601): at org.apache.harmony.luni.net.PlainSocketImpl
     .connect(PlainSocketImpl.java:533)
W/System.err(10601): at java.net.Socket
     .connect(Socket.java:1074)
W/System.err(10601): at org.apache.http.conn.scheme.PlainSocketFactory
     .connectSocket(PlainSocketFactory.java:119)
Run Code Online (Sandbox Code Playgroud)

谢谢.

MapTestActivity

public class MapTestActivity extends FragmentActivity
    implements LocationListener, LocationSource{

    private GoogleMap mMap;
    private OnLocationChangedListener mListener;
    private LocationManager locationManager;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_map_test);     
        setupLocationManager();     
        setupMapIfNeeded();
    }

    private void setupLocationManager() {
        this.locationManager …
Run Code Online (Sandbox Code Playgroud)

android overlay wms geoserver google-maps-android-api-2

8
推荐指数
1
解决办法
5248
查看次数