Hexagon Geospatial
MENU

GeoMedia

Search for an answer, post a question, or answer other users' questions in our GeoMedia support discussions. This discussion board is a great way to collaborate with industry peers around the world. It is intended for discussion and support of the GeoMedia Desktop and Add-on applications.
Showing results for 
Search instead for 
Do you mean 
Reply
Occasional Contributor
Posts: 9
Registered: ‎06-21-2018

Ascii Unloader compatible with GeoMedia 2016?

Dear all,

does anyone know whether the Ascii Unlaoder is still compatible with GeoMedia 2016?

Thanks.

Staff
Posts: 108
Registered: ‎05-26-2016

Re: Ascii Unloader compatible with GeoMedia 2016?

 

If your only outputting Point Geometry or Attribute Data, and you have GeoMedia Professiona 2018 - v16.5  Spatial Modeler

you now can output GeoCSV with the feature output operator. You can use Select Attributes operator to order output and save to a csv.

 

Staff
Posts: 108
Registered: ‎05-26-2016

Re: Ascii Unloader compatible with GeoMedia 2016?

Another Alternative is to Export to Oracle Object Model , the resultant .DAT file is a pipe "|" delimited file. Simply replace the "|" with a comma ","

 

There is also ":" and ";" to remove, and some oracle sql fields if desired. This can be done simply with a text editor, and you have a csv

 

So you can create a selection query to order the attributes and geometry of any feature type, Then run Export to Oracle Object Model 

 

I've used a simple vbs script here which requires no compile/linking

 

Sample Features_line.DAT file (of line features created by Oracle export)

 

100|1000|3002| |pt||||1|2|1|;499523.26243742811|6127181.7384954523|0|500523.26243742811|6127181.7384954523|0|:
101|920|3002| |pt||||1|2|1|;499484.56162244244|6127243.4213725384|0|500404.37767762406|6127261.8176936423|0|:
102|920|3002| |pt||||1|2|1|;500404.37767762406|6127261.8176936423|0|500412.79947127064|6127261.9861295149|0|:
103|1340|3002| |pt||||1|2|1|;499387.61233600928|6126937.1028824244|0|499697.02495228534|6127125.8445783528|0|499988.90418697248|6126874.1889837822|0|500278.72067088436|6127067.0561812604|0|500503.19815725542|6126971.2928499188|0|:
104|1340|3002| |pt||||1|2|1|;500503.19815725536|6126971.2928499188|0|500503.56050537829|6126971.1382702151|0|:

 

I then run my script on command line inputs are input and output filenames

 

cscript /nologo run_dat_to_csv.vbs  Feature_line.dat   Feature_line.csv

 

Resultant Features_line.csv

 

100,1000,499523.26243742811,6127181.7384954523,0,500523.26243742811,6127181.7384954523,0,
101,920,499484.56162244244,6127243.4213725384,0,500404.37767762406,6127261.8176936423,0,
102,920,500404.37767762406,6127261.8176936423,0,500412.79947127064,6127261.9861295149,0,
103,1340,499387.61233600928,6126937.1028824244,0,499697.02495228534,6127125.8445783528,0,499988.90418697248,6126874.1889837822,0,500278.72067088436,6127067.0561812604,0,500503.19815725542,6126971.2928499188,0,
104,1340,500503.19815725536,6126971.2928499188,0,500503.56050537829,6126971.1382702151,0,

 

Here's my run_dat_to_csv.vbs included in zip

 

You can see the 4 lines below you could edit to remove unwanted fields, change "|" to "," and remove ; and :

 

        strLine = Replace(strLine,"3002| |pt||||1|2|1|","") - remove oracle fileds
        strLine = Replace(strLine,"|",",") - replace pipe to comma
        strLine = Replace(strLine,":","") - remove colon
        strLine = Replace(strLine,";","") - remove semi-colon

 

 

 

 

 

 

Staff
Posts: 108
Registered: ‎05-26-2016

Re: Ascii Unloader compatible with GeoMedia 2016?

Alternately you can use Export to Oracle Spatial Model. It create a .dat file which is a pipe delimited file. You can simply edit the “|” to a “,” and you have a CSV file. There are some Oracle fields you can easily delete, and some oracle terminators “:” and”;”

 

So just do a selection query in GeoMedia and order the Geometry and Attributes you desire, then export to oracle.

 

Here’s an example of some line features exported (Feature_line.dat)

 

100|1000|3002|pt||||1|2|1|;499523.26243742811|6127181.7384954523|0|500523.26243742811|6127181.7384954523|0|:

101|920|3002||pt||||1|2|1|;499484.56162244244|6127243.4213725384|0|500404.37767762406|6127261.8176936423|0|:

102|920|3002||pt||||1|2|1|;500404.37767762406|6127261.8176936423|0|500412.79947127064|6127261.9861295149|0|:

103|1340|3002||pt||||1|2|1|;499387.61233600928|6126937.1028824244|0|499697.02495228534|6127125.8445783528|0|499988.90418697248|6126874.1889837822|0|500278.72067088436|6127067.0561812604|0|500503.19815725542|6126971.2928499188|0|:

104|1340|3002||pt||||1|2|1|;500503.19815725536|6126971.2928499188|0|500503.56050537829|6126971.1382702151|0|:

 

I use a simple interpretive vbs script I run on command line

 

cscript /nologo run_dat_to_csv.vbs  Feature_line.dat  Feature_line.csv

 

The resultant Feature_line.csv opens in Excel

 

100,1000,499523.26243742811,6127181.7384954523,0,500523.26243742811,6127181.7384954523,0,

101,920,499484.56162244244,6127243.4213725384,0,500404.37767762406,6127261.8176936423,0,

102,920,500404.37767762406,6127261.8176936423,0,500412.79947127064,6127261.9861295149,0,

103,1340,499387.61233600928,6126937.1028824244,0,499697.02495228534,6127125.8445783528,0,499988.90418697248,6126874.1889837822,0,500278.72067088436,6127067.0561812604,0,500503.19815725542,6126971.2928499188,0,

104,1340,500503.19815725536,6126971.2928499188,0,500503.56050537829,6126971.1382702151,0,

  

 

In the run_dat_to_csv.vbs  are 4 lines I use to edit , you can modify for any data

 

       strLine = Replace(strLine,"3002| |pt||||1|2|1|","") - removes oracle fields

       strLine = Replace(strLine,"|",",") – replaces pipe with comma

       strLine = Replace(strLine,":","") – removes colon terminator

       strLine = Replace(strLine,";","") – removes semi-colon terminator

 

Here’s the run_dat_to_csv.vbs script

 

' Run_dat_to_csv.vbs

Dim Filename,Filename_CSV,Tempfile

Const ForAppending = 8

Const TristateFalse = 0 ' the value for ASCII

Const Overwrite = True

 

If WScript.Arguments.Count = 2 Then

                Filename = WScript.Arguments.Item(0)

                Filename_CSV = WScript.Arguments.Item(1)

Else

   Wscript.Echo "Usage: Run_dat_to_csv.vbs <Filename.dat> <Filename.csv> "

   Wscript.Quit

End If

Set objFS = CreateObject("Scripting.FileSystemObject")

Set objFile = objFS.OpenTextFile(Filename)

Set TempFile = objFS.CreateTextFile(Filename_CSV, Overwrite, TristateFalse)

 

Do Until objFile.AtEndOfStream

   strLine = objFile.ReadLine

   If InStr(strLine,"|")> 0 Then

       strLine = Replace(strLine,"3002| |pt||||1|2|1|","")

       strLine = Replace(strLine,"|",",")

       strLine = Replace(strLine,":","")

       strLine = Replace(strLine,";","")

   End If

                TempFile.WriteLine(strLine)

Loop

Filename.Close

TempFile.Close

 

Wscript.Quit

 

 

 

Staff
Posts: 108
Registered: ‎05-26-2016

Re: Ascii Unloader compatible with GeoMedia 2016?

[ Edited ]

Alternately you can use Export to Oracle Spatial Model. It creates a .dat file which is a pipe delimited file. You can simply edit the “|” to a “,” and you have a CSV file. There are some Oracle fields you can easily delete, and some oracle terminators “:” and”;” to remove.

 

Occasional Contributor
Posts: 9
Registered: ‎06-21-2018

Re: Ascii Unloader compatible with GeoMedia 2016?

[ Edited ]

Thanks a lot. That is really helpful.

Do you need immediate support?
If you encounter a critical issue and need immediate assistance please submit a Service Request through our Support Portal.