[GRASS-user] writing MicroStatioin DGN files

gisfisch at t-online.de gisfisch at t-online.de
Tue Jan 16 02:11:14 PST 2024


Markus,

the conversion to DGN works fine with OGR2OGR (using a GPKG as intermediate format, that means the data go DGN -> GRASS -> GPGK -> DGN).
No error messages, result looks fine, even the DGN symbology is preseved as desired.
That means, the problem must be in GRASS. How to solve?

best regards, Uwe

-----Ursprüngliche Nachricht-----
Von: Markus Neteler <neteler at osgeo.org> 
Gesendet: Sonntag, 14. Januar 2024 13:45
An: gisfisch at t-online.de
Cc: grass-user at lists.osgeo.org
Betreff: Re: [GRASS-user] writing MicroStatioin DGN files

Uwe,

On Sat, Jan 13, 2024 at 12:38 AM <gisfisch at t-online.de> wrote:
>
> Markus,
>
> thank you very much for your answer.
> In your example, you used any GRASS map with any columns. They can obviously not be written to DGN (eg. MAJORRDS_).

I see - I am not familiar with the DGN format.

> Please note that in my workflow, the DGN is imported into GRASS, then processed and then written back. So the GRASS map must have the correct DGN colums because it was created from DGN by GRASS itself.
> When I import a DGN and use db.select right after that, I get:
>
> cat|Type|Level|GraphicGroup|ColorIndex|Weight|Style|EntityNum|MSLink|Text|ULink
> 1|17|1|0|2|2|0|||423|{ "32047": [ { "size": 8, "raw": [ "0x1003", 
> 1|17|1|0|2|2|0|||423|"0x7d2f", "0x0871", "0x0000" ], "type": "ODBC" } 
> 1|17|1|0|2|2|0|||423|] }
> 2|17|1|0|2|2|0|||424|{ "32047": [ { "size": 8, "raw": [ "0x1003", 
> 2|17|1|0|2|2|0|||424|"0x7d2f", "0x0872", "0x0000" ], "type": "ODBC" } 
> 2|17|1|0|2|2|0|||424|] }
> 3|17|1|0|2|2|0|||426|{ "32047": [ { "size": 8, "raw": [ "0x1003", 
> 3|17|1|0|2|2|0|||426|"0x7d2f", "0x0873", "0x0000" ], "type": "ODBC" } 
> 3|17|1|0|2|2|0|||426|] }
>
> Then, when I use v.out.ogr -s to skip the cat column, the driver complains about the Type column. But that one is undoubtedly part of the fixed DGN schema, as you can see above.
> I understand that writing any random colums can not work, but I try to write exactly the DGN schema.
>
> Please let me emphasize again that it worked fine for years in GRASS 7.0.

GRASS GIS 7.0 was from Feb 20, 2015 :-) A lot has happened since then.

> I assume there is a bug in the younger GRASS versions. Or has anybody succeeded in writing out DGNs?

Note that GRASS GIS is offloading the write-out of the data to GDAL/OGR. Does ogr2ogr conversion work with your data and a recent GDAL version?

Overall: the only reasonable way to find out is - since we don't have your data - to create a reproducible example with e.g. the North Carolina sample data (essentially what I tried not knowing your workflow).
Could you provide that?

Best regards,
Markus



More information about the grass-user mailing list