DMS-Aus / MapManager

46 stars 24 forks source link

[Question] Styling OGR layer #38

Open fmg-lydonchandra opened 2 years ago

fmg-lydonchandra commented 2 years ago

Hi @szekerest how are you ? Do you have an example map file to style OGR layer ? Eg. if I open a DXF file in MapManager, how do I target and style the layer ?

  LAYER
    CONNECTION "dxf1.dxf"
    CONNECTIONTYPE OGR
    NAME "line"
    PROCESSING "GETSHAPE_STYLE_ITEMS=all"
    STATUS ON
    TEMPLATE "query.html"
    TILEITEM "location"
    TYPE LINE
    UNITS METERS
    CLASS
      NAME "Class (0)"
      STYLE
        COLOR 0 0 0
        SIZE 8
      END # STYLE
      TEMPLATE "query.html"
    END # CLASS
    CLASS
      NAME "Class (1)"
      STYLE
        COLOR 0 0 0
      END # STYLE
    END # CLASS
  END # LAYER

ogrinfo output:

OGRFeature(entities):224
  Layer (String) = STOCKPILES
  SubClasses (String) = AcDbEntity:AcDbPolyline
  Linetype (String) = VULCAN_LINE_TYPE_1
  EntityHandle (String) = BFC
  Style = PEN(c:#ffbb00,w:0.3g,p:"0.024g 0.072g")
  LINESTRING Z (1 1 411,2 2 411,3 3 411,4 4  411)
szekerest commented 2 years ago

@fmg-lydonchandra You should set auto style for the layer to let mapserver take the feature style into account

image

fmg-lydonchandra commented 2 years ago

Without using Auto Style, is it possible to style OGRFeature (using our own style)? eg. when Layer is STOCKPILES make it blue when Layer is LAYER1 make it red ?

OGRFeature(entities):224
  Layer (String) = STOCKPILES
  SubClasses (String) = AcDbEntity:AcDbPolyline
  Linetype (String) = VULCAN_LINE_TYPE_1
  EntityHandle (String) = BFC
  Style = PEN(c:#ffbb00,w:0.3g,p:"0.024g 0.072g")
  LINESTRING Z (1 1 411,2 2 411,3 3 411,4 4  411)
lydonchandra commented 5 months ago

Hi @szekerest , is there Linux C# Mapscript Nuget package for Mapserver 8.0 that you can upload to nuget? It looks like the current one is for Mapserver 7.0?

https://www.nuget.org/packages/OSGeo.Mapscript.x64

image

szekerest commented 5 months ago

@lydonchandra There's no official nugets for Mapscript, the referred nuget seems to be an outdated contribution. Creating working nugets for Linux seems to be a challenging task due to the number of unmanaged dependencies, which should also be available on that platform.

lydonchandra commented 4 months ago

Thanks for the info @szekerest , turns out it was quite straightforward to build working Mapscript DLL for my system (Linux based on Debian 11)