Controlling movement of vehicle agents on GIS roads - anylogic

I am developing an anylogic simulation with GIS library. I have created vehicle as a population of agents on the GIS map. How can I use the roads of the gis map similar to the roads of Road Library? in order to control car movements on GIS map roads. I have also tried using shape files for roads to convert gis routes into Roads. But the shape file includes other areas too apart from just the main roads I want. Kindly guide If anyone has expertise over GIS Library Anylogic.

Create a shapefile yourself with what you need using arcGIS (it will not be easy and will require A LOT of work)
Creat a .osm or .pbf file where you can control the routing of cars yourself instead of relying in an external server that controls your routes (also arcGIS required and A LOT of work)
What you are asking is not easy and I have the feeling you are looking for an easy solution. And I think points 1 and 2 are necessary, but depending on what you want point 2 may be enough.
Nevertheless, no matter what you do, you will never have the same behavior as the road traffic library unless you create yourself the map with the traffic library itself (again an immense amount of work if you have a lot of routes). You can nevertheless use an image of the map you are interested in, and put the roads from the traffic library where you need them.
you CANNOT put roads from the traffic library on a GIS map.

Related

Is there any way to use AnyLogic traffic simulation by using GIS map without building all roads using "Road" from Road traffic library?

I am working on traffic volume simulation model for big city. The simulation can be done perfectly by building roads using "Road" from Road traffic library. However, The simulation model is for big city and it is very hard to draw all roads with detailes. Is there is any way to simulate the traffic roads directly by GIS or any other way?
the answer to this question is no.
The road traffic library is not compatible with GIS features, nevertheless if you have a shapefile with the roads, you can transform it into the road traffic objects, but you will need to fix a lot of small details and add traffic lights in a very manual way.
You can also automate the creation of all your road objects on startup if you have a file that has all the definitions, but you will need to do a lot of advanced coding for this.
I have always been scared to do a project like this because even with small models, the creation of roads is very hard.
I would suggest also to look into other better traffic simulators such as SUMO, which I think is the most popular on the topic.

Drawing unity 3D Map based on real world map

I'm using mapbox SDK for unity. I'm trying to build a 3D map based on a real world map.
mapbox have some really nice features but all areas are not implemented yet, such as deserts in Saudi Arabia.
Does anyone have an idea about how can I elevate the desert into beautiful 3D map using mapbox?
Or do you know any other SDK for unity that can help me with this?
Please note that I need to use real world coordinates (Longitude,
Latitude) in my game, Pins will be inserted on map based on real world
coordinates.
Elevation Data Sources
There are multiple sources that provide elevation data. Bing Maps, Mapbox and ArgGIS (ESRI) are the most well-known services in that area. In rare cases like deserts some of them cover areas whereas the others do not. In your case if MapBox does not cover the Saudi-Arabian desert you can try out one of those other sources.
Mixed Data Sources
In order so solve your problem within MapBox you have to first extract data from a viable source and provide it to MapBox. Fortunately MapBox supports third-party data: MapBox: how to use custom data
There are also many third-party tools that you can use or learn from.
Have a look at this Asset from the Unity Asset Store for example: Online Maps v3
This asset allows you to keep your MapBox style, cache the tiles locally to save cost, use multiple elevation sources, create 3D-buildings in cities and fill in relevant data from the google api.
Missing Data
In order to have a globally working game you have to check multiple sources and use the one that has the elevation data that you want. Unfortunately, in some cases you won't find any data at all as it has not been mapped yet at all. In this case you have to exclude it from your game.

Is it possible to make car drive on the opposite direction lane in the road traffic library?

I'm currently doing simulation on autonomous vehicles in Anylogic. But the problem for me now is that I don't know in the road traffic library of Anylogic, if it's possible for the cars to change lane and drive on the opposite direction to avoid obstacles on the current lane(considering a road with one lane for each direction). Or is there any simulation software can simulate that scenario?
enter image description here
It's not possible to do that particular maneuver with the road traffic library. You will have to use the process modeling library (PML) to avoid obstacles and change lanes to the opposite direction. This means that you will have to construct the car intelligence in order to avoid collisions.
You can nevertheless use traffic library everywhere and mix it with PML in those particular segments, but that is quite complicated.
In general for autonomous vehicles it's better to use the PML... the road traffic library is quite limited.

Mapping Indoor Floor Plan into OSM-XML for Use in iPhone App

I am currently working on a project at my home university to create an infrastructure-less indoor navigation iPhone application. I have a couple of questions regarding IndoorOSM and hope that experts here can steer me towards the right direction.
Given an indoor floor plan, how can I make use of JOSM to map it into OSM-XML format? I understand that the floor plan will be represented as nodes, ways, tags and relations with each node having a lat-lon value. As the indoor space I would like to map is located in Singapore where there is little existing mapping work done, I am not sure where to accurately place the floor plan in JOSM before modelling (the buildings are non-existent). The thing is, if I start modelling on a wrong location, the lat-lon values generated in the OSM-XML file will be way off from the lat-lon values in actual real world space, right? In that case I don't think I will be able to make use of the magnetometer to identify where the user is currently at on the map...
In the OSM wiki, it was mentioned that nodes represent a geospatial point and ways are simply a collection of 2-2000 nodes and can be used to represent an area. Pardon my ignorance, but how can I know what's the physical size/area of this "point" or node?
Other than IndoorOSM, is there an easier way to convert an indoor floor plan into something that my application can understand and use easily to allow navigation? I seen a project known as roodin on youtube but I'm not sure how they did the mapping (link).
I'm also working on app with similar functionalities. What I understand is:
1 - When mapping a building you should mapping with correct lat/long. It shouldn't be difficult to get building coordinates if you can go there and check coordinates with a smartphone with GPS. With you can't go there, it's more difficult. Maybe ask someone to do that helps you. But, to start drawing your floor plan, you don't need coordinates. you can do that after finish your drawing
2 - When use JOSM to drawing, it show (in status bar) the length of your way
3 - Currently, I'm sticking with IndoorOSM. I liked the way they reuse nodes, ways and relations to draw a floor plan. That's my recommendation

Indoor map creator

I have designed and developed couple of navigation apps using google API and osmdroid API for android powered devices. Now I am looking to create an Indoor navigation system using osmdroid API. But, in order to do so I need to create tiles similar to regular map tiles from an simple PNG file with naming convention similar to OpenStreetMap.
Please suggest me how to do this?
Cheers,
Susheel
You could design your indoor map using JOSM. Save it to a .osm file. Don't upload the data to OpenStreetMap unless it is a appropriate to do so (OpenStreetMap has some basic some indoor features, e.g. a highway=footway running through a shopping mall, but generally a lot of very detailed indoor stuff will be inappropriate for OSM) But...
With a .osm file you could then use one of the OpenStreetMap rendering tools to create a raster map, and chop it into tiles. For quick satisfaction I'd recommend Maperative, although I'm not sure how easy the last tile chopping step is. I've never done this with Maperative. Mapnik has a nice generate_tiles.py output, which will give you the tileset you want, but it's a bit tricky to set up in the first place.
Actually the last step is the main thing you're asking about. You can chop up any image into tiles. It may or may not be important to you that the tiles are geo-positioned in some meaningful way. For an old project I did a quick fudge solution using google tile cutter script, which is actually a wrapper around GDAL tools.
Have a look at the gdal library, and in particular gdal2tiles. This is a library designed to create maps from raster images, and serves exactly your purpose.
You can decide on a projection and what the bounds of your source image(s) are. The library allows you to reproject your image to the correct coordinate space.
It can also generate tiles at various zoom levels using gdal2tiles, either with or without reprojection.
Now you can check indoor rendering by drag and dropping OSM geojson data into https://app.openindoor.io web page.