Shahrukh,

I use MicroStation daily and have a licensed product so this would only work if 
you have it installed.

Depending on your Bentley MicroStation version I’ve had some success writing C# 
addin for the software to interpret Bentley elements and output geojson.

In the latest version (v10.17.02.61) you could do some trickery using the new 
“Item Types”, I haven’t made one for geojson direct however I’ve had success 
exporting an excel spreadsheet then using GDAL to convert this to geojson.

I’ve tested this with simple linestring and simple shape elements with upto 100 
vertices (there’s currently no way of looping every vertex).


  1.  Create an Item Type for LineStrings call it WKT_LINE and create another 
one for Shape WKT_SHAPE or something that makes sense to you.
  2.  Add a property call it WKT or whatever you would like the geometry column 
to be called.
  3.  Set the following:
     *   Property Definition

                                                               i.      Type: 
Text

                                                             ii.      Is Array: 
False

                                                           iii.      Is 
ReadOnly: True

                                                           iv.      Visibility: 
Show

     *   Calculated Property

                                                               i.      
Expression SEE BELOW

                                                             ii.      Use last 
valid value: False

                                                           iii.      Failure 
Value: ERROR GENERATING LINESTRING

  1.  Attach this item to required elements.
     *   WKT_LINE can be appended to simple linestring elements
     *   WKT_SHAPE can be appended to simple shape elements
  2.  Use MicroStation Export Item Types to export a spreadsheet
  3.  Use GDAL to convert spreadsheet to geojson or anything you want

Expression for LineString use first line below then repeat second line as many 
times as you like, increment the number each time, 1 becomes 2, 2 becomes 3 etc 
etc…. (Eventually would impact performance I guess), end with the last line.

"LINESTRING (" & IIF(this.GetElement().Count > 0, 
this.GetElement().Segments[0].Start.X & " " & 
this.GetElement().Segments[0].Start.Y,"")
& IIF(this.GetElement().Count > 1, ", " & this.GetElement().Segments[1].Start.X 
& " " & this.GetElement().Segments[1].Start.Y,"")
& ", " & this.GetElement().Segments[this.GetElement().Count-1].End.X & " " & 
this.GetElement().Segments[this.GetElement().Count-1].End.Y &")"

Expression for Shape / Polygon use first line below then repeat second line as 
many times as you like, increment the number each time, 1 becomes 2, 2 becomes 
3 etc etc…. (Eventually would impact performance I guess), end with the last 
line.

"POLYGON ((" & IIF(this.GetElement().Count > 0, 
this.GetElement().Segments[0].Start.X & " " & 
this.GetElement().Segments[0].Start.Y,"")
& IIF(this.GetElement().Count> 1, ", " & this.GetElement().Segments[1].Start.X 
& " " & this.GetElement().Segments[1].Start.Y,"")
& ", " & IIF(this.GetElement().Count>0,this.GetElement().Segments[0].Start.X & 
" " & this.GetElement().Segments[0].Start.Y,"") & "))"

Cheers
Adam

From: gdal-dev <gdal-dev-boun...@lists.osgeo.org> On Behalf Of Shahrukh Mirza 
Nawandish
Sent: Tuesday, September 5, 2023 3:11 PM
To: gdal-dev@lists.osgeo.org
Subject: [gdal-dev] : Inquiry about Converting MicroStation V8 DGN to GeoJSON 
or Alternative Formats


Dear GDAL Support Team,

Is there a cost-effective or open-source solution for converting MicroStation 
V8 DGN files to GeoJSON or other formats, as the Open Teigha SDK comes with a 
cost.
Any suggestions or guidance would be appreciated.
--
Saygılarımla / Kind Regards

Shahrukh Mirza NAWANDISH
Havacılık Bilgi Sistemleri / Aeronautical Information Systems
Yazılım Geliştirme Uzm. Yrd. / Software Development Assist. Specialist
Bilgisayar Programcısı / Computer Programmer MCA
[https://www.haritaevi.com/wp-content/uploads/2018/12/haritaevi-logo.png]<https://www.haritaevi.com/en>
T:+90 312 266 66 98
M:+90 538 519 72 67
E:mirza.nawand...@haritaevi.com<http://mirza.nawand...@haritaevi.com>
▶: Ankara-Istanbul-Bucharest<https://www.haritaevi.com/en/about-us/contact>
www.haritaevi.com<http://www.haritaevi.com>
www.obstacleanalyze.com<http://www.obstacleanalyze.com>
www.aerodatamarket.com<http://www.aerodatamarket.com>
[https://avatars.mds.yandex.net/get-mail-signature/2434044/d24bf65965f2be07edc47ff3c25b0348/orig]<https://www.instagram.com/haritaevi/?hl=tr>[https://avatars.mds.yandex.net/get-mail-signature/200369/c75763261eac7fb671922d147573080b/orig]<https://www.linkedin.com/company/haritaevi-havac%C4%B1l%C4%B1k-m%C3%BChendislik-a-%C5%9F>[https://avatars.mds.yandex.net/get-mail-signature/2434044/1cd6e615d44979bf9b0d6b0ea9c47182/orig]<https://twitter.com/haritaevi>[https://avatars.mds.yandex.net/get-mail-signature/232821/ec6941b191f27730d3a5f92fd846beb4/orig]<https://www.youtube.com/channel/UCZHA_PmyMLg__KOfNgOLJYg?view_as=subscriber>[https://avatars.mds.yandex.net/get-mail-signature/232821/0545b2da2dc9f49f532774615ec45e51/orig]<https://www.facebook.com/haritaevi>[https://www.haritaevi.com/wp-content/uploads/2022/02/disclaimer_1.png]<https://www.haritaevi.com/disclaimer>
 
[https://avatars.mds.yandex.net/get-mail-signature/2434044/58c47a3a908e28fdb209656734002f36/orig]
 <https://fidic.org> 
[https://avatars.mds.yandex.net/get-mail-signature/2423644/1ccfc2184635533811e43aeeae4bf6c1/orig]
 <https://www.efcanet.org> 
[https://avatars.mds.yandex.net/get-mail-signature/2423644/405b95fb41fb8db77dcee35ff542f333/orig]
 <https://www.haritaevi.com/en/about-us/quality-policy> 
[https://avatars.mds.yandex.net/get-mail-signature/1539903/c89e02562564f32028015473ea475742/orig]
 <https://www.haritaevi.com/en/about-us/information-security-policy>



Note:
This message is for the named person's use only.  It may contain confidential, 
proprietary or legally privileged information.  No confidentiality or privilege 
is waived or lost by any mistransmission.  If you receive this message in 
error, please immediately delete it and all copies of it from your system, 
destroy any hard copies of it and notify the sender.  You must not, directly or 
indirectly, use, disclose, distribute, print, or copy any part of this message 
if you are not the intended recipient. The Port of Brisbane reserves the right 
to monitor all e-mail communications through its networks.
If you have received this transmission in error please let us know by 
contacting us on +61 7 3258 4888 or by reply E-Mail to the sender.
Any views expressed in this message are those of the individual sender, except 
where the message states otherwise and the sender is authorised to state them 
to be the views of any such entity.
 
Thank You.
_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to