geoserver+mysql+openlayers问题点

1. tomcat下部署geoserver解决跨域访问问题

报错:Access to XMLHttpRequest at 'http://localhost:8900/geoserver/cite/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=cite%3Apoi&maxFeatures=50&outputFormat=application%2Fjson' from origin 'http://localhost:8090' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

2. win10 处理shp数据进入mysql(报错cygwin1.dll丢失

3. wfs要素url:

例:http://localhost:8900/geoserver/cite/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=cite%3Apoints&maxFeatures=50&outputFormat=application%2Fjsongeojson:

{
    "type": "FeatureCollection",
    "features": [
        {
            "type": "Feature",
            "id": "points.1",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    116.311,
                    40.014
                ]
            },
            "geometry_name": "location",
            "properties": {
                "name": "圆明园",
                "x": "116.310558",
                "y": "40.014033"
            }
        },
        {
            "type": "Feature",
            "id": "points.2",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    116.335,
                    40.0105
                ]
            },
            "geometry_name": "location",
            "properties": {
                "name": "清华大学",
                "x": "116.335279",
                "y": "40.010497"
            }
        },
        {
            "type": "Feature",
            "id": "points.3",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    116.278,
                    40.0065
                ]
            },
            "geometry_name": "location",
            "properties": {
                "name": "颐和园",
                "x": "116.277787",
                "y": "116.277787"
            }
        },
        {
            "type": "Feature",
            "id": "points.4",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    116.405,
                    39.9154
                ]
            },
            "geometry_name": "location",
            "properties": {
                "name": "天安门",
                "x": "116.404844",
                "y": "39.915378"
            }
        },
        {
            "type": "Feature",
            "id": "points.5",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    116.434,
                    39.9101
                ]
            },
            "geometry_name": "location",
            "properties": {
                "name": "北京站",
                "x": "116.434164",
                "y": "39.910065"
            }
        },
        {
            "type": "Feature",
            "id": "points.6",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    116.225,
                    39.8565
                ]
            },
            "geometry_name": "location",
            "properties": {
                "name": "卢沟桥",
                "x": "116.224895",
                "y": "39.85647"
            }
        },
        {
            "type": "Feature",
            "id": "points.7",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    116.327,
                    39.9025
                ]
            },
            "geometry_name": "location",
            "properties": {
                "name": "北京西站",
                "x": "116.32723",
                "y": "39.901652"
            }
        },
        {
            "type": "Feature",
            "id": "points.8",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    116.612,
                    39.9025
                ]
            },
            "geometry_name": "location",
            "properties": {
                "name": "北京首都国际机场",
                "x": "116.612388",
                "y": "40.085613"
            }
        }
    ],
    "totalFeatures": 8,
    "numberMatched": 8,
    "numberReturned": 8,
    "timeStamp": "2022-07-27T15:18:10.256Z",
    "crs": {
        "type": "name",
        "properties": {
            "name": "urn:ogc:def:crs:EPSG::4326"
        }
    }
}

4.效果

 

问题参考:

1. 图解将shape file导入MySQL数据库中 - 知乎 (zhihu.com)

2. 将shp文件导入到mysql数据库中 - whh - 博客园 (cnblogs.com)

3. geoserver跨域问题解决 - 陈先生86 - 博客园 (cnblogs.com)

4. GeoServer 2.15.2版本跨域问题解决方法 - 昜木辰deブログ - 博客园 (cnblogs.com)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
路径分析是指在地理信息系统中,根据给定的起和终,在网络数据中找到最佳或最短的路径。在本例中,我们将使用PostgreSQL数据库、GeoServerOpenLayers来实现路径分析。 首先,我们需要将网络数据导入PostgreSQL数据库。我们可以使用PostGIS插件来处理空间数据,它提供了丰富的空间分析功能。将网络数据导入数据库后,我们可以使用SQL查询进行路径分析。 接下来,我们需要将数据库中的数据发布到GeoServer中。GeoServer是一个开源的地理信息服务器,它可以将数据库中的空间数据发布为Web服务。通过GeoServer,我们可以将网络数据以WMS或WFS的形式发布出去,供OpenLayers进行可视化展示和交互。 最后,我们可以使用OpenLayers来在Web页面中显示地图,并实现路径分析的可视化。OpenLayers是一个开源的JavaScript库,它提供了丰富的地图显示和交互功能。我们可以使用OpenLayers的API来加载GeoServer发布的网络数据,并通过JavaScript代码来实现路径分析的功能。例如,我们可以在地图上绘制起和终,并使用OpenLayers的路线计算函数来找到最佳路径,并将其显示在地图上。 在整个过程中,PostgreSQL提供了数据存储和查询的功能,GeoServer提供了数据发布的功能,而OpenLayers提供了地图的可视化和交互功能。通过这些工具的结合,我们可以实现路径分析的功能,从而为用户提供最佳或最短路径的查询和展示。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Jennifer33K

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值