TIGER data Mapfile update.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

TIGER data Mapfile update.

blammo
Tp whom it may concern . . .

I’ve recently been optimzing some MapServer layer MapFiles in our system for TIGER based centerline data to take advantage of the newer capabilities of MapServer.  The MapFile I’ve been working on recently  was just over 10 years old!!  Anyway, lot’s of new stuff for optimizing the Mapfile and I wanted to pass the results by the list to see if there is anything I may have missed.

For long time list users, you may remember my post in the past about setting up a “googlish” type layer style for MapServer way back when.  This is my refactoring of that MapFile to the new look and feel of the Google style(s). 

This mapfile has mutiple CLASSes with many STYLE settings per CLASS.  So it ens up a bit complicated.

I’ve also switch all data sourcing over from SHP file to Postgres/PostGIS as well as consolidating the all the DATA connection calls into a single call.  While the old file ran very fast, this one comes back almost instantly now, even for very large images.

Here are a couple of fragments of the MAPFILE that I’ve currently set up, and just looking for thoughts on improving it even more.

Sample output is here:


 and the fragment below is for the Interstate roads, darker yellow color and Hwy Shields..

Thanks

bobb

. . . .
LAYER

#DEBUG 5

    NAME 'street centerlines'
    TYPE LINE
STATUS DEFAULT

CONNECTIONTYPE POSTGIS

INCLUDE "../../../../conf/spatial_db/connection_compass.inc"

DATA "wkb_geometry from (select 
objectid,
-- cmmsparent,
-- cmmsid,
-- l_f_add,
-- r_f_add,
-- l_t_add,
-- r_t_add,
streetall,
-- f_xstreet,
-- t_xstreet,
-- msa_route,
-- ownership,
-- maintained,
-- stp_class,
-- rowclass,
-- speed_lim,
-- length_ft,
-- base,
-- surface,
-- parking_mi,
-- lane_mi,
-- oneway,
-- cmmschgreq,
-- streetname,
-- type,
-- sufdir,
hwy_numb,
f_class,
-- cencty_l,
-- cenmun_l,
-- censt_r,
-- cencty_r,
-- cenmun_r,
-- gnis_l,
-- gnis_r,
-- fips5_l,
-- fips5_r,
-- zip5_l,
-- zip5_r,
-- alt_nam1,
-- alt_nam2,
-- created_user,
-- created_date,
-- last_edited_user,
-- last_edited_date,
wkb_geometry
      from stpgis.stpaul_streetcenterline) as subquery using unique objectid using srid=200068"

    CLASSITEM 'f_class'
    LABELITEM ‘streetall'

. . . .

—————————————-


#######
# A10
#######

    CLASS
      #NAME 'US Interstate'  ## Using Interstate Shield Symbol Instead
      EXPRESSION 'A10' # interstates
      LABEL
        TYPE TRUETYPE
        FONT bluehigh
        SIZE 10
        COLOR 254 254 254
        MINDISTANCE 100
        MINFEATURESIZE 50
        OFFSET 0 0
        PARTIALS FALSE
TEXT '[hwy_numb]'   ## be careful here with the call, you need to quote the bracketed token !!
## Also, this is a multiple LABELITEM.
        STYLE
          SYMBOL 'interstate1_wide_back'
          SIZE 18
          COLOR 254 254 254 ## WHITE banner border
        END      
        STYLE
          SYMBOL 'interstate1_wide_back'
          SIZE 16
          COLOR 255 0 0 ## RED banner
        END
        STYLE
          SYMBOL 'interstate1_wide_front'
          SIZE 18
          COLOR 254 254 254 ## WHITE shield border
        END      
        STYLE
          SYMBOL 'interstate1_wide_front'
          SIZE 16
          COLOR 56 120 199 ## BLUE(ish) shield color
        END      
      END


      STYLE  
        OUTLINEWIDTH 1
        OUTLINECOLOR 175 175 175 
        WIDTH 9  
        COLOR 249 222 77
      MAXSCALEDENOM 20000
      END

      STYLE  
      MINSCALEDENOM 20000
        OUTLINEWIDTH 1
        OUTLINECOLOR 175 175 175 
        WIDTH 6  
        COLOR 249 222 77
      MAXSCALEDENOM 25000
      END

      STYLE  
      MINSCALEDENOM 25000
        OUTLINEWIDTH 1
        OUTLINECOLOR 175 175 175 
        WIDTH 2 
        COLOR 249 222 77
      END

    END
    TEMPLATE 'TEMPLATES/stpaul_record.html'
  TOLERANCE 15
  TOLERANCEUNITS pixels
 
  END ##end Layer




You miss 100 percent of the shots you never take.
—Wayne Gretzky


_______________________________________________
mapserver-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapserver-users
Reply | Threaded
Open this post in threaded view
|

Re: TIGER data Mapfile update.

Dan Little-2
Hey Bob,

Is there any chance you can start a GitHub repo with an appropriate license and maybe some screenshots for this? It's hard to use dropbox as a collaboration platform...

Cheers,

-Duck

On Mon, Jan 8, 2018 at 1:39 PM, Basques, Bob (CI-StPaul) <[hidden email]> wrote:
Tp whom it may concern . . .

I’ve recently been optimzing some MapServer layer MapFiles in our system for TIGER based centerline data to take advantage of the newer capabilities of MapServer.  The MapFile I’ve been working on recently  was just over 10 years old!!  Anyway, lot’s of new stuff for optimizing the Mapfile and I wanted to pass the results by the list to see if there is anything I may have missed.

For long time list users, you may remember my post in the past about setting up a “googlish” type layer style for MapServer way back when.  This is my refactoring of that MapFile to the new look and feel of the Google style(s). 

This mapfile has mutiple CLASSes with many STYLE settings per CLASS.  So it ens up a bit complicated.

I’ve also switch all data sourcing over from SHP file to Postgres/PostGIS as well as consolidating the all the DATA connection calls into a single call.  While the old file ran very fast, this one comes back almost instantly now, even for very large images.

Here are a couple of fragments of the MAPFILE that I’ve currently set up, and just looking for thoughts on improving it even more.

Sample output is here:


 and the fragment below is for the Interstate roads, darker yellow color and Hwy Shields..

Thanks

bobb

. . . .
LAYER

#DEBUG 5

    NAME 'street centerlines'
    TYPE LINE
STATUS DEFAULT

CONNECTIONTYPE POSTGIS

INCLUDE "../../../../conf/spatial_db/connection_compass.inc"

DATA "wkb_geometry from (select 
objectid,
-- cmmsparent,
-- cmmsid,
-- l_f_add,
-- r_f_add,
-- l_t_add,
-- r_t_add,
streetall,
-- f_xstreet,
-- t_xstreet,
-- msa_route,
-- ownership,
-- maintained,
-- stp_class,
-- rowclass,
-- speed_lim,
-- length_ft,
-- base,
-- surface,
-- parking_mi,
-- lane_mi,
-- oneway,
-- cmmschgreq,
-- streetname,
-- type,
-- sufdir,
hwy_numb,
f_class,
-- cencty_l,
-- cenmun_l,
-- censt_r,
-- cencty_r,
-- cenmun_r,
-- gnis_l,
-- gnis_r,
-- fips5_l,
-- fips5_r,
-- zip5_l,
-- zip5_r,
-- alt_nam1,
-- alt_nam2,
-- created_user,
-- created_date,
-- last_edited_user,
-- last_edited_date,
wkb_geometry
      from stpgis.stpaul_streetcenterline) as subquery using unique objectid using srid=200068"

    CLASSITEM 'f_class'
    LABELITEM ‘streetall'

. . . .

—————————————-


#######
# A10
#######

    CLASS
      #NAME 'US Interstate'  ## Using Interstate Shield Symbol Instead
      EXPRESSION 'A10' # interstates
      LABEL
        TYPE TRUETYPE
        FONT bluehigh
        SIZE 10
        COLOR 254 254 254
        MINDISTANCE 100
        MINFEATURESIZE 50
        OFFSET 0 0
        PARTIALS FALSE
TEXT '[hwy_numb]'   ## be careful here with the call, you need to quote the bracketed token !!
## Also, this is a multiple LABELITEM.
        STYLE
          SYMBOL 'interstate1_wide_back'
          SIZE 18
          COLOR 254 254 254 ## WHITE banner border
        END      
        STYLE
          SYMBOL 'interstate1_wide_back'
          SIZE 16
          COLOR 255 0 0 ## RED banner
        END
        STYLE
          SYMBOL 'interstate1_wide_front'
          SIZE 18
          COLOR 254 254 254 ## WHITE shield border
        END      
        STYLE
          SYMBOL 'interstate1_wide_front'
          SIZE 16
          COLOR 56 120 199 ## BLUE(ish) shield color
        END      
      END


      STYLE  
        OUTLINEWIDTH 1
        OUTLINECOLOR 175 175 175 
        WIDTH 9  
        COLOR 249 222 77
      MAXSCALEDENOM 20000
      END

      STYLE  
      MINSCALEDENOM 20000
        OUTLINEWIDTH 1
        OUTLINECOLOR 175 175 175 
        WIDTH 6  
        COLOR 249 222 77
      MAXSCALEDENOM 25000
      END

      STYLE  
      MINSCALEDENOM 25000
        OUTLINEWIDTH 1
        OUTLINECOLOR 175 175 175 
        WIDTH 2 
        COLOR 249 222 77
      END

    END
    TEMPLATE 'TEMPLATES/stpaul_record.html'
  TOLERANCE 15
  TOLERANCEUNITS pixels
 
  END ##end Layer




You miss 100 percent of the shots you never take.
—Wayne Gretzky


_______________________________________________
mapserver-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapserver-users


_______________________________________________
mapserver-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapserver-users
Reply | Threaded
Open this post in threaded view
|

Re: TIGER data Mapfile update.

blammo
Dan,

Ok, I’ll have to get good at all that new fangled stuff sooner or later, but I didn’t have to go through all this the last time I let folks use it.     :c)

I was planning on putting it out as a package when done.  I have it installed and running right now, waiting to see if I get any errors reported.



bobb



On Jan 8, 2018, at 3:53 PM, Dan Little <[hidden email]> wrote:

Hey Bob,

Is there any chance you can start a GitHub repo with an appropriate license and maybe some screenshots for this? It's hard to use dropbox as a collaboration platform...

Cheers,

-Duck



"Computers in the future may weigh no more than 1.5 tons."
--Popular Mechanics, forecasting the relentless march of science, 1949


_______________________________________________
mapserver-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapserver-users