GeoJson

GeoJson格式数据的形式

Using GeoJSON with Leaflet

GeoJSON is becoming a very popular data format among many GIS technologies and services — it‘s simple, lightweight, straightforward, and Leaflet is quite good at handling it. In this example, you‘ll learn how to create and interact with map vectors created from GeoJSON objects.

译:通过Leaflet使用GeoJson。

GeoJSON是一种在GIS工程和服务中变的很流行的数据格式,简单,轻量级,明确,并且Leaflet能很好的处理它。

单个要素数据:

var geojsonFeature = {
"type": "Feature",          //要素类型
"properties": {                //属性
    "name": "Coors Field",
    "amenity": "Baseball Stadium",
    "popupContent": "This is where the Rockies play!"
},
"geometry": {                //要素地理坐标
    "type": "Point", //元素类型
    "coordinates": [-104.99404, 39.75621]  //坐标
}
};

要素集合的定义形式:

var geojsonFeature={
    "type": "FeatureCollection",        //要素集合
    "features": [
        {
            "type": "Feature",        //要素类型
            "id": "6328",
            "properties": {            //属性
                "flag":‘100‘,
                "name": "海西蒙古族藏族自治州",
                "cp": [
                    94.9768,
                    37.1118
                ],
                "childNum": 7
            },
            "geometry": {            //要素地理坐标
                "type": "MultiPolygon",
                "coordinates": [
                    [
                    .........
时间: 2024-08-02 18:45:39

GeoJson的相关文章

IIS支持json、geojson文件

最近在搞asp.net + openlayers. 其中openlayer有个数据源支持 .geojson 数据,但是怎么测试都不能成功.同样的数据拿到php下就能成功显示. 搓. 在网上漫无目的的搜索,asp.net + geojson,aspx+geojson, javascript+geojson..... 终于最后搜索到IIS+json/geojson 这样的关键字. http://coastalrocket.blogspot.kr/2013/01/allowing-jsongeojso

Json 与GeoJson

1.JSON介绍 JSON(JavaScript Object Notation) 是一种轻量级的数据交换格式.简单地说,JSON 可以将 JavaScript 对象中表示的一组数据转换为字符串,然后就可以在函数之间轻松地传递这个字符串,或者在异步应用程序中将字符串从 Web 客户机传递给服务器端程序.这个字符串看起来有点儿古怪,但是JavaScript很容易解释它,而且 JSON 可以表示比"名称 / 值对"更复杂的结构. JSON 语法是 JavaScript 对象表示语法的子集.

OpenLayers添加点【php请求MySQL数据库返回GeoJSON数据】

php请求MySQL数据库返回GeoJSON数据的实现方法请参见: http://www.cnblogs.com/marost/p/6234514.html OpenLayers[v3.19.1-dist]添加GeoJSON数据源图层 <!doctype html> <html lang="en"> <head> <link rel='stylesheet' href='ol.css'> <style> #map { heig

Echarts-地图扩展-标准geoJson格式扩展地图-例子

本人菜鸟一枚,最近搞echarts地图.看到官方给的"标准geoJson格式扩展地图-全国主要城市"的例子,瞬间就蒙逼了.不怪人官网的例子不好,实在是我看不懂它是怎么弄得.最后折腾了一晚上,最后终于弄出个想样子的例子来.(有同感的收藏下,高手勿喷!) 下面这个例子是我弄得汕尾市的,里面的链接是我项目的,我就不改了.这段代码其实是两个例子凑起来的,大家也可以再自己的项目里面试试.中间绿色部分是抄的官方的"标准geoJson格式扩展地图-全国主要城市"code.其他代码

[Javascript] Adding Shapes to Maps with Leaflet and GeoJSON

<!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8"> <title>Leaflet Demo</title> <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.3/leaflet.css&qu

postgis 利用 php 返回geojson格式数据

直接上代码 1.db_config.php <?php /* * All database connection variables */ $host = "host=127.0.0.1"; $port = "port=5432"; $dbname = "dbname=soil"; $credentials = "user=postgres password=123456"; ?> 2.getGeojson.php

php请求返回GeoJSON格式的数据

<?php /* * Following code will list all the products */ // array for JSON response $response = array(); // include db connect class require_once __DIR__ . '/db_connect.php'; // connecting to db $db = new DB_CONNECT(); // get all products from product

Arcgis for js,Openlayers中加载GeoJSON

概述: 在前文中,讲述了在JAVA环境下如何将shp转换为GeoJSON,在本文,分别讲述在Arcgis for js,Openlayers2和Openlayers3中加载展示GeoJSON. 实现: 1.Openlayers2中加载GeoJSON 在OL2中,可以直接调用OL2的借口实现GeoJSON的加载,代码示例: <!DOCTYPE html> <html> <head lang="en"> <meta charset="UT

【 D3.js 入门系列 — 10.3 】 GeoJSON 文件和 TopoJSON 文件的区别和联系

本人的个人博客为:www.ourd3js.com csdn博客为:blog.csdn.net/lzhlzz 转载请注明出处,谢谢. 前些天有朋友留言询问 GeoJSON 文件和 TopoJSON 文件的关系,正好我其实也不是十分明了,查询了一番后整理如下,还望大家指证. 这两种文件都是基于 JSON 语法的,首先来说一下 JSON 语法和文件是怎样的. 1. JSON 格式 JSON(JavaScript Object Notation) 是一种轻量级的数据交换语言,以文字为基础,且易于让人阅读

geojson数据类型面转线Transforms Polygons and MultiPolygons to LineStrings.

function flatten(array) { return [].concat.apply([], array); } function polygonToLineString(coordinates, properties) { return coordinates.map(function(coordinates) { return turf.lineString(coordinates, properties); }); } function multiPolygonToLineSt