This repository has been archived by the owner on Oct 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
geojson_cn
温绍锦 edited this page Mar 28, 2020
·
1 revision
GeoJSON是一种对各种地理数据结构进行编码的格式,基于JSON表示法的地理空间信息数据交换格式。具体规范参考官方网站 https://geojson.org/
com.alibaba.fastjson.support.geo.Geometry
com.alibaba.fastjson.support.geo.GeometryCollection
com.alibaba.fastjson.support.geo.Feature
com.alibaba.fastjson.support.geo.FeatureCollection
com.alibaba.fastjson.support.geo.LineString
com.alibaba.fastjson.support.geo.MultiLineString
com.alibaba.fastjson.support.geo.Point
com.alibaba.fastjson.support.geo.MultiPoint
com.alibaba.fastjson.support.geo.Polygon
com.alibaba.fastjson.support.geo.MultiPolygon
String str = "{\n" +
" \"type\": \"MultiPoint\",\n" +
" \"coordinates\": [\n" +
" [100.0, 0.0],\n" +
" [101.0, 1.0]\n" +
" ]\n" +
"}";
Geometry geometry = JSON.parseObject(str, Geometry.class);
assertEquals(MultiPoint.class, geometry.getClass());
assertEquals("{\"type\":\"MultiPoint\",\"coordinates\":[[100.0,0.0],[101.0,1.0]]}", JSON.toJSONString(geometry));
String str2 = JSON.toJSONString(geometry);
assertEquals(str2, JSON.toJSONString(JSON.parseObject(str2, Geometry.class)));
如有需要修改本注脚,请联系阿里巴巴,
© Alibaba Fastjson Develop Team
注明: 版权所有阿里巴巴,请注明版权所有者
If you need to amend this footnote, please contact Alibaba.
© Alibaba Fastjson Develop Team
Note: Copyright Alibaba, please indicate the copyright owner