You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
woodbri@mappy:~/work/geoserver$ cat mapfile2sld
#!/usr/bin/perl -w
use strict;
use mapscript;
sub Usage {
die "Usage: mapfile2sld mapfile out_dir\n";
}
my $mf = shift @ARGV || Usage();
my $dir = shift @ARGV || Usage();
mkdir $dir, 0777;
die "Directory '$dir' does not exist or failed to create it! : $!\n"
unless -d $dir;
my $oMap = new mapscript::mapObj( $mf );
for (my $i=0; $i<$oMap->{numlayers}; $i++) {
my $oLay = $oMap->getLayer($i);
my $SLD = $oLay->generateSLD();
my $fname = "$dir/" . $oLay->{name} . ".xml";
open(OUT, ">$fname") || die "Failed to create '$fname'! : $!\n";
print OUT $SLD;
close(OUT);
}
LAYER
NAME "linear_water"
METADATA
"ows_title" "Streams and Rivers"
"ows_srs" "EPSG:4269 EPSG:4326"
"ows_abstract" "Streams and Rivers from the U.S. Census LINEARWATER data layer."
END
TYPE LINE
TILEINDEX "tidx-LINEARWATER"
PROJECTION
"+proj=longlat +ellps=GRS80 +datum=NAD83" #EPSG: 4269
END
#INCLUDE "map-LINEARWATER.inc"
# map-LINEARWATER.inc
MAXSCALEDENOM 15000
CLASS # water
STYLE
COLOR "#a5bfdd"
WIDTH 1.0
END
LABEL
MAXSCALEDENOM 10000
TYPE TRUETYPE
FONT "sans-italic"
SIZE 8
COLOR "#627A9D"
OUTLINECOLOR "#B3C9E2"
PARTIALS FALSE
MINDISTANCE 250
MINFEATURESIZE 10
BUFFER 4
ANGLE FOLLOW
PRIORITY 4
END
END
END
The text was updated successfully, but these errors were encountered:
This issue has been closed due to lack of activity. This doesn't mean the issue is invalid, it simply got no attention within the last year. Please reopen with missing/relevant information if still valid.
Typically, issues fall in this state for one of the following reasons:
Hard, impossible or not enough information to reproduce
Missing test case
Lack of a champion with interest and/or funding to address the issue
Only 16 of 32 layers generated useful SLD files using perl mapscript. using mapserver 6.2.0-beta1. I can supply the whole mapfile if it is needed.
Here is my perl script:
16 of the files contain nothing more than this:
Here is the layer definition:
The text was updated successfully, but these errors were encountered: