Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] Styling OGR layer #38

Open
fmg-lydonchandra opened this issue Aug 24, 2022 · 5 comments
Open

[Question] Styling OGR layer #38

fmg-lydonchandra opened this issue Aug 24, 2022 · 5 comments

Comments

@fmg-lydonchandra
Copy link

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
Copy link
Member

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

image

@fmg-lydonchandra
Copy link
Author

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
Copy link

lydonchandra commented Jun 18, 2024

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
Copy link
Member

@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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants