# Feature Request: Item Types Expression that will allow to calculate distance between point A and B

I am working as Electrical Engineer on Railway Infrastructure Projects. One of the latest client's requirement is to provide a carbon assessment for the proposed design. As a part of design we need to consider carbon contribution during manufacturing process, transportation from manufacturer to site, maintenance and installation. I thought that for the calculation of carbon contribution associated with transportation of equipment from manufacturer to construction site,  it would be very useful if there is an expression for item types where:

• First argument takes coordinates of point A
• Second argument takes coordinates of point B,
• Third argument takes type of transportation(car, train, flight

and the returned value is a distance between point A and B (I guess it could use Google Maps or Bing Maps API).

I could then create a cell library with item type attached into each of the cell with the following properties:

• Company Name
• Coordinates,
• Transport Type,
• Fuel Consumption,
• Distance (calculated by expression, where first argument is Item Type Property "Coordinates", second argument takes the coordinates from the placement point of cell and the third one takes takes Item Type Property "Transport Type"

I guess that if MicroStation already allows to synchronise view with Google Earth and Bing Maps, implementing such expression would not be difficult and would be very useful.

• implementing such expression would not be difficult and would be very useful

Perhaps, however:

Third argument takes type of transportation(car, train, flight

each of your transportation types use a different approach to get from points A to B

• A plane (theorectically, flying in the air) is a simple linear vector subtraction of B from A.
• A car is restricted to using roads
• A train is restricted to a railway

How do you imagine that Item Types will be able to determine the true length of the route for a car or train, simply from 2 coordinates?

Here's a random real-world example where all 3 types of transportation can travel from the same XY coordinates i.e. from Point A to Point B (Car = Red / Plane = Green / Train = Blue)

• each of your transportation types use a different approach to get from points A to B

• A plane (theorectically, flying in the air) is a simple linear vector subtraction of B from A.
• A car is restricted to using roads
• A train is restricted to a railway

How do you imagine that Item Types will be able to determine the true length of the route for a car or train, simply from 2 coordinates?

Here's a random real-world example where all 3 types of transportation can travel from the XY coordinates of Point A to Point B (Car = Red / Plane = Green / Train = Blue)

I do not see any problem.  These approaches can be split, so that air, train and car transport can be calculated in separate Item Type Property. Then you can do some computation and then return the final value with carbon contribution into another Item Type Property. Details can be taken from manufacturer and applied accordingly at the stage when cell is created. You can add fourth argument (or even more) that will decide whether your route should be optimal or the fastest or you can type only three and the fourth will take default value which is for example "Optimal" Google Maps and Bing Maps does this computing and selection already. Similarly like most of navigation systems in the car.

• So your request is to somehow have the MicroStation interact with the Google Maps Platform to automatically determine the quickest route, applicable to each transportation type, using Google's Distance Matrix API, and have that distance information be returned back to MicroStation and stored in an Item Type? Its feasible I guess, although an initial hurdle to overcome is to how provide the Distance Matrix API with appropriate input it needs i.e. the coordinates you use in your model(s) will be Cartesian coordinates (perhaps to a specific GCS) and from what I have seen, it takes Latitude and Longitude as its input, so a careful conversion would need to take place. I don't think its something you can expect to see anytime soon so if distance information is needed, you'll just have to do it the old manual way extracting the length property from an element.

• So your request is to somehow have the MicroStation interact with the Google Maps Platform to automatically determine the quickest route, applicable to each transportation type, using Google's Distance Matrix API, and have that distance information be returned back to MicroStation and stored in an Item Type? Its feasible I guess, although an initial hurdle to overcome is to how provide the Distance Matrix API with appropriate input it needs i.e. the coordinates you use in your model(s) will be Cartesian coordinates (perhaps to a specific GCS) and from what I have seen, it takes Latitude and Longitude as its input, so a careful conversion would need to take place. I don't think its something you can expect to see anytime soon so if distance information is needed, you'll just have to do it the old manual way extracting the length property from an element.

Yes, I was hoping to interact somehow with Google's Distance Matrix API or any other alternative and return distance back to MicroStation. I agree with you that a careful conversion is required especially that some of the projects are not set up properly. You cannot even sync them with Bing Maps or Google Earth. I have posted this request just to give an idea about the feature that would be useful, although I am aware that it will not be implemented soon.

• it would be very useful if there is an expression for item types where:

• First argument takes coordinates of point A
• Second argument takes coordinates of point B,
• Third argument takes type of transportation(car, train, flight

Item Types are too low-level for your application.  An Item instance is simply data tacked on to a DGN element.  Item Types don't have the concepts of a relationship, where Thing A is connected in some way to Thing B.

The task you describe is a good match for a Geographic Information System (GIS).  Vanilla MicroStation is not a GIS.

In the Bentley world, GIS means OpenCities Map.  If we can assume that your customer is in the UK, then the map data provided by the Ordnance Survey provides the detailed information (e.g. road vectors) you need to implement your application.

Similarly like most of navigation systems in the car

That is a good example of a GIS!

Regards, Jon Summers
LA Solutions