Opened 14 months ago

Last modified 2 months ago

#7121 new enhancement

DXF: Keep track of object visibility and paper/model space

Reported by: Alan Thomas Owned by: warmerdam
Priority: normal Milestone:
Component: OGR_SF Version: svn-trunk
Severity: normal Keywords: dxf


Split out from #4369:

Added new attributes for features:

  • "PaperSpace?" -> Absent or "0" means model space, "1" means paper space.
  • "Invisible" -> Indicates the object visibility: "0" = visible, "1" = invisible

Paper space uses a completely different coordinate system from model space, so I wonder if we could even just ignore entities in paper space, or alternatively shove them in a different OGR feature layer or something.

Change History (7)

comment:1 Changed 13 months ago by Alan Thomas

In 40712:

DXF: Correct color for ByBlock? text features; respect hidden objects (refs #5592, refs #7099, refs #7121)

comment:2 Changed 13 months ago by Alan Thomas

Turns out we already supported hidden/frozen layers by making the features on those layers transparent. r40712 adds support for individually hidden/frozen objects as well.

Still to decide what to do with paper space entities.

comment:3 Changed 9 months ago by Marc Weustink

All nice and well, but this way it is only supported by color. IE, transparent means hidden. If you render this it gives the desired result. But what if you want to do some queries, to get the visible and plotted extent for instance ?

I would like to do something like: select * from entities where visible=1 and plotted=1

it would be nice to distinguish if a layer is visible/frozen/plotted

comment:4 Changed 9 months ago by Alan Thomas

You can do something like

ogrinfo text-fancy.dxf -al -where "OGR_STYLE LIKE '%c:#______00%'"

to select hidden entities. This will work whether the object is in a hidden layer, or individually hidden.

I don't think we keep track of the other settings. To be honest I can't really make sense of the difference between visible, frozen, and plotted. What do you think is the best behaviour for GDAL here? Also does the new DXF_INCLUDE_RAW_CODE_VALUES config option help you?

comment:5 Changed 9 months ago by Marc Weustink

Don't know if DXF_INCLUDE_RAW_CODE_VALUES will help, but is sounds promising. I need to find/build a GDAL 2.3 to test. (and before I can use it a mapserver using it)

Initially the difference between visible and frozen weren't clear to me. The answers here make something clear.

Autocad won't process anything on a frozen layer. In case of GDAL I think skipping frozen layers is a bit to much, but having the option would be nice.

Plotted layers are only printed/plotted. For instance I receive maps from our customers where there are utility layers (like grids) which are visible, but not plotted/printed

comment:7 Changed 2 months ago by DonnyV

Adding a property like "IsVisible?" with values 0 or 1 would make it more obvious. It would take the extra step of having to parse the color away. I would still keep the transparent color though. So not to break compatibility.

Note: See TracTickets for help on using tickets.