[mapserver-users] Bad BBOX passed to db query
Jack Walters
jack.walters at zonarsystems.com
Tue Sep 24 11:46:41 PDT 2013
If that is the case, wouldn't that affect the longitude and latitude and
not just the longitude?
As far as I know, setting the UNITS to meters has been the established
way to set up the mapfile for the past 4+ years. Removing it completely
doesn't seem to change anything. I tried changing it to one of ther
other options available [dd|feet|inches|kilometers|miles|nauticalmiles]
and no change except to the lables where they were visibled previously.
I'm still pretty new to the logic here. I am inheriting this code and
trying to make it work for mapserver 6.2.1 from 5.6.5.
It would seem that removing the projection item from the layers, setting
the main projection to AUTO and only referencing the 4326 projection
from the map->web->metadata->wms_srs and the db calls is the only
solution. It is almost like it is reprocessing the longitude when the
PROJECTION items are set to 4326 in the MAP and LAYER.
Really, I was wondering if there were any issues with my solution?
Thanks,
Jack Walters
Web Development Engineer III
Zonar Systems
On 9/24/2013 10:18 AM, Fawcett, David (MNIT) wrote:
> Notice that your Map projection is 4326, but that your Map units are set to meters.
>
> I am guessing that this is your problem.
>
> The map units and the units that the map extent are expressed in have to match your map projection/srs.
>
> David.
>
> -----Original Message-----
> From: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Jack Walters
> Sent: Tuesday, September 24, 2013 11:17 AM
> To: Lime, Steve D (MNIT); mapserver-users at lists.osgeo.org
> Subject: Re: [mapserver-users] Bad BBOX passed to db query
>
> Before Update:
> ___________________________
> MAP
> EXTENT -138 40 -110 60
> SIZE 500 500
> UNITS meters
> FONTSET "/var/www/gtc/html/current/mapping/maps/_fonts/fonts.lst"
>
> WEB
> METADATA
> "wms_title" "Zonar Web Mapping"
> "wms_srs" "epsg:4326 epsg:99999 epsg:4269"
> "tile_map_edge_buffer" "256" # 16 pixel rendering buffer
> "tile_metatile_level" "2" # metatile 2 levels up (4:1 = 1024px metatile)
> END #METADATA
> END #WEB
>
> TRANSPARENT true
>
> PROJECTION
> "init=epsg:4326"
> END #PROJECTION
>
> OUTPUTFORMAT
> NAME png
> DRIVER AGG/PNG
> IMAGEMODE RGB
> MIMETYPE "image/png"
> END
>
> ###############################################################
> # SYMBOLS
> ###############################################################
>
> SYMBOL
> NAME "misc_circle"
> TYPE ellipse
> FILLED true
> POINTS
> 1 1
> END
> END
> SYMBOL
> NAME "triangle_circle"
> TYPE ellipse
> FILLED true
> POINTS
> 1 1
> END
> END
> SYMBOL
> NAME "triangle_arrow"
> TYPE vector
> FILLED true
> POINTS
> 0 -3
> 3 6
> 0 4
> -3 6
> 0 -3
> END
> END
>
> ###############################################################
> # LAYERS
> ###############################################################
> LAYER
> NAME "loi_names"
>
> DATA "geom FROM ([query]) AS new_table USING UNIQUE id USING SRID=4326"
> CONNECTIONTYPE postgis
> CONNECTION "user=qa1 dbname=qa1 password=qa1 host=dev-db-001"
>
> TYPE ANNOTATION
> STATUS OFF
> PROJECTION
> "init=epsg:4326"
> END #PROJECTION
> METADATA
> "wms_title" "loi_names"
> END #METADATA
>
> LABELITEM "name"
>
> CLASS
> LABEL
> EXPRESSION ([area] >= 70)
> MINSCALEDENOM 36978669.43 # Z#3
> MAXSCALEDENOM 295829355.45 # Z#23+
> BUFFER 10
> FONT VeraBi
> SIZE 8
> TYPE truetype
> WRAP "/"
> COLOR [rgb_color]
> OUTLINEWIDTH 2
> OUTLINECOLOR 210 210 210
> MINFEATURESIZE 60
> END #LABEL
> END #CLASS
> CLASS
> LABEL
> EXPRESSION ([area] >= 0.4)
> MINSCALEDENOM 9244667.36 # Z#23+
> MAXSCALEDENOM 36978669.43 # Z#3
> BUFFER 10
> FONT VeraBi
> SIZE 8
> TYPE truetype
> WRAP "/"
> COLOR [rgb_color]
> OUTLINEWIDTH 2
> OUTLINECOLOR 210 210 210
> MINFEATURESIZE 60
> END #LABEL
> END #CLASS
> CLASS
> LABEL
> MINSCALEDENOM 0 # Z#23+
> MAXSCALEDENOM 9244667.36 # Z#6
> BUFFER 10
> FONT VeraBi
> SIZE 10
> TYPE truetype
> WRAP "/"
> COLOR [rgb_color]
> OUTLINEWIDTH 2
> OUTLINECOLOR 210 210 210
> MINFEATURESIZE 60
> END #LABEL
> END #CLASS
> END #LAYER
>
>
> LAYER
> NAME "loi_polys"
> DATA "geom FROM ([query]) AS new_table USING UNIQUE id USING SRID=4326"
> CONNECTIONTYPE postgis
> CONNECTION "user=qa1 dbname=qa1 password=qa1 host=dev-db-001"
>
> TYPE polygon
> STATUS OFF
> PROJECTION
> "init=epsg:4326"
> END #PROJECTION
> METADATA
> "wms_title" "Locations of Interest polys"
> "wms_timeextent" "2000-01-01/2100-01-01"
> "wms_timeitem" "ts"
> END #METADATA
>
> LABELITEM "name"
>
> CLASS
> STYLE
> OUTLINECOLOR [rgb_color]
> END #STYLE
> END #CLASS
> END #LAYER
>
> LAYER
> NAME "loi_lines"
> DATA "geom FROM ([query]) AS new_table USING UNIQUE id USING SRID=4326"
> CONNECTIONTYPE postgis
> CONNECTION "user=qa1 dbname=qa1 password=qa1 host=dev-db-001"
>
> TYPE line
> STATUS OFF
> PROJECTION
> "init=epsg:4326"
> END #PROJECTION
> METADATA
> "wms_title" "Locations of Interest lines"
> "wms_timeextent" "2000-01-01/2100-01-01"
> "wms_timeitem" "ts"
> END #METADATA
>
> LABELITEM "name"
> CLASS
> STYLE
> COLOR [rgb_color]
> END #STYLE
> END #CLASS
> END #LAYER
> END #MAP
> ______________________________________
>
> After Update:
> ______________________________________
> MAP
> EXTENT -138 40 -110 60
> SIZE 500 500
> UNITS meters
> FONTSET "/var/www/gtc/html/current/mapping/maps/_fonts/fonts.lst"
>
> WEB
> METADATA
> "wms_title" "Zonar Web Mapping"
> "wms_srs" "epsg:4326 epsg:99999 epsg:4269"
> "tile_map_edge_buffer" "256" # 16 pixel rendering buffer
> "tile_metatile_level" "2" # metatile 2 levels up (4:1 = 1024px metatile)
> END #METADATA
> END #WEB
>
> TRANSPARENT true
>
> PROJECTION
> AUTO
> END #PROJECTION
>
> OUTPUTFORMAT
> NAME png
> DRIVER AGG/PNG
> IMAGEMODE RGB
> MIMETYPE "image/png"
> END
>
> ###############################################################
> # SYMBOLS
> ###############################################################
>
> SYMBOL
> NAME "misc_circle"
> TYPE ellipse
> FILLED true
> POINTS
> 1 1
> END
> END
> SYMBOL
> NAME "triangle_circle"
> TYPE ellipse
> FILLED true
> POINTS
> 1 1
> END
> END
> SYMBOL
> NAME "triangle_arrow"
> TYPE vector
> FILLED true
> POINTS
> 0 -3
> 3 6
> 0 4
> -3 6
> 0 -3
> END
> END
>
> ###############################################################
> # LAYERS
> ###############################################################
> LAYER
> NAME "loi_names"
> STATUS OFF
> TYPE POINT
>
> CONNECTIONTYPE postgis
> CONNECTION "user=qa1 dbname=qa1 password=qa1 host=dev-db-001"
> PROCESSING "CLOSE_CONNECTION=DEFER"
>
> DATA "geom FROM ([query]) AS new_table USING UNIQUE id USING SRID=4326"
>
> METADATA
> "wms_title" "loi_names"
> END #METADATA
>
> LABELITEM "name"
>
> CLASS
> LABEL
> EXPRESSION ([area] >= 70)
> MINSCALEDENOM 36978669.43 # Z#3
> MAXSCALEDENOM 295829355.45 # Z#23+
> BUFFER 10
> FONT VeraBi
> SIZE 8
> TYPE truetype
> WRAP "/"
> COLOR [rgb_color]
> OUTLINEWIDTH 2
> OUTLINECOLOR 210 210 210
> MINFEATURESIZE 60
> END #LABEL
> LABEL
> EXPRESSION ([area] >= 0.4)
> MINSCALEDENOM 9244667.36 # Z#23+
> MAXSCALEDENOM 36978669.43 # Z#3
> BUFFER 10
> FONT VeraBi
> SIZE 8
> TYPE truetype
> WRAP "/"
> COLOR [rgb_color]
> OUTLINEWIDTH 2
> OUTLINECOLOR 210 210 210
> MINFEATURESIZE 60
> END #LABEL
> LABEL
> MINSCALEDENOM 0 # Z#23+
> MAXSCALEDENOM 9244667.36 # Z#6
> BUFFER 10
> FONT VeraBi
> SIZE 10
> TYPE truetype
> WRAP "/"
> COLOR [rgb_color]
> OUTLINEWIDTH 2
> OUTLINECOLOR 210 210 210
> MINFEATURESIZE 60
> END #LABEL
> END #CLASS
> END #LAYER
> LAYER
> NAME "loi_polys"
> DEBUG 1
> STATUS OFF
> TYPE POLYGON
>
> CONNECTIONTYPE postgis
> CONNECTION "user=qa1 dbname=qa1 password=qa1 host=dev-db-001"
> PROCESSING "CLOSE_CONNECTION=DEFER"
>
> DATA "geom FROM ([query]) AS new_table USING UNIQUE id USING SRID=4326"
>
> LABELITEM "name"
> METADATA
> "wms_title" "loi_polys"
> END #METADATA
>
> CLASS
> STYLE
> OUTLINECOLOR [rgb_color]
> END #STYLE
> END #CLASS
> END #LAYER
> LAYER
> NAME "loi_lines"
> STATUS OFF
> TYPE LINE
>
> CONNECTIONTYPE postgis
> CONNECTION "user=qa1 dbname=qa1 password=qa1 host=dev-db-001"
> PROCESSING "CLOSE_CONNECTION=DEFER"
>
> DATA "geom FROM ([query]) AS new_table USING UNIQUE id USING SRID=4326"
>
> LABELITEM "name"
> METADATA
> "wms_title" "loi_lines"
> END #METADATA
>
> CLASS
> STYLE
> COLOR [rgb_color]
> END #STYLE
> END #CLASS
> END #LAYER
> END #MAP
> ______________________________
>
> Hope that helps.
>
> Thanks,
> Jack Walters
> Web Development Engineer III
> Zonar Systems
>
>
> Confidentiality Notice: This e-mail may contain proprietary information some of which may be legally privileged. It is for the intended recipient(s) only. If you believe that it has been sent to you in error, please notify the sender by reply e-mail and delete the message. Any disclosure, copying, distribution or use of this information by someone other than the intended recipient(s) is prohibited and may be unlawful.
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>
>
Confidentiality Notice: This e-mail may contain proprietary information some of which may be legally privileged. It is for the intended recipient(s) only. If you believe that it has been sent to you in error, please notify the sender by reply e-mail and delete the message. Any disclosure, copying, distribution or use of this information by someone other than the intended recipient(s) is prohibited and may be unlawful.
More information about the MapServer-users
mailing list