在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):ghengeveld/graphql-geojson开源软件地址(OpenSource Url):https://github.com/ghengeveld/graphql-geojson开源编程语言(OpenSource Language):JavaScript 100.0%开源软件介绍(OpenSource Introduction):graphql-geojsonGraphQL schema object types for GeoJSON. Based on GeoJSON Object Schema. Installationnpm i -S graphql-geojson or with Yarn: yarn add graphql-geojson Usageimport { GraphQLObjectType, GraphQLSchema } from 'graphql'
import { PointObject } from 'graphql-geojson'
export default new GraphQLSchema({
query: new GraphQLObjectType({
name: 'Query',
fields: () => ({
point: {
type: PointObject,
resolve: () => ({
type: 'Point',
coordinates: [-105.01621, 39.57422],
crs: {
type: 'name',
properties: {
name: 'urn:ogc:def:crs:OGC:1.3:CRS84',
},
},
}),
},
}),
}),
}) Then you can query it like this: query {
point {
type
coordinates
crs {
type
properties {
... on GeoJSONNamedCRSProperties {
name
}
}
}
}
} DemoAn example GraphQL server implementation is available here: https://github.com/ghengeveld/graphql-geojson-demo |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论