span8
span4
我的目标是创建一个匹配以下模板的JSON文件。我一直在努力获得linestring几何属性的坐标格式正确。注意“tippecanoe”属性的添加。
{“type”:“Feature”,“tippecanoe”:{“maxzoom”:9,“minzoom”:4},“properties”:{“FULLNAME”:“N Vasco Rd”},“geometry”:{“type”:“LineString”,“coordinates”:[[-121.733350,37.767671],[-121.733600,37.767483],[-121.733131,37.766952]}}
我试过的东西:
concat('[[',几何学:点(xy, ', ', '], [', ']]”)
这种方法有效,但感觉有些陈腐;它添加了引号(“),我稍后将其删除。
几何学:get-text-data(几何学:获取名称())
第二个方法返回空值。我用GeometryPropertySetter为几何图形指定了一个名称,但仍然返回一个空值。如果有人可以张贴一个工作的例子,我可以从那里。文件很少。谢谢你!
嗨@justinmatis,您可以使用GeometryExtractor (GeometryEncoding: GeoJSON)将几何特征转换为几何字符串'{"type":
{"type": "Feature", "tippecanoe": {"maxzoom": fme:get-attribute("maxzooom"), "minzoom": fme:get-attribute("minzoom")}, "properties": {"FULLNAME": fme:get-attribute("FULLNAME")}, "geometry": fme:get-json-attribute("_geometry")}
{“type”:“Feature”,“tippecanoe”:{“maxzoom”:fme:get attribute(“maxzoom”),“minzoom”:fme:get attribute(“minzoom”)},“properties”:{“FULLNAME”:fme:get attribute(“FULLNAME”)},“geometry”:{“type”:“LineString”,“coordinates”:[对于tokenize中的$coord(geom:get points(“xy”),'\s')return[对于tokenize中的$v($coord,')返回xs:double($v)]}
©2019安全亚搏在线软件公司法律