How can I log my position regularly in a GIS Model?

大憨熊 提交于 2020-01-06 06:01:21

问题


I have a GIS model where a truck leaves a main distributor, visits several customers along a route to make deliveries, and then return to the distributor once it is empty. The route is chosen based on proximity of agents to the main distributor and to each other. I'm trying to figure out how to log the route the truck took in order to make the deliveries, though I have not been able to do so yet. Any help is greatly appreciated. Thank you!


回答1:


If you want to log street names (as you do):

You can't.

Not with the free GIS map service that pulls data from OSM. I believe that you could do it from Google Maps services but it is very expensive... Your only chance is to download OpenStreeMap shapefiles of the area of interest, convert them into a network of paths and pull the street names from there.

The OSM shapefiles should have street names in their dbf files and you can specify in the AnyLogic GIS map object in which column of your dbf file the street names are located. Then, upon converting to path objects, AnyLogic will name the path object according to the street name.

But to be honest, this is not trivial and might be overkill for you. Maybe think about logging something else?




回答2:


In order to log coordinates i would use a collection of type GISRoute. This is the type you are getting anyway when calculating route for your truck. And GISRoute contains an array of segments (GISMarkupSegment). And every segment has a start and end (type Point) with its lat and lon (methods getLatitude, getLongitude).



来源:https://stackoverflow.com/questions/57434533/how-can-i-log-my-position-regularly-in-a-gis-model

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!