Getting blank tiles in google maps

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

Getting blank tiles in google maps

vaibhavgarg
Hi all, I am new to MapServer.

I have downloaded and setup MS4W and was able to overlay the example Bath and other map data on google maps.

I then created my own .map file using QGIS and supplied my data but the served tiles are completely blank(transparant or white when I select RGB).

My data set is .GML and I also tried converting it to .SHP format. I have checked that my setup is ok by doing is on two different computers.

When I use shp2img.exe then it renders the layers properly.
c:\> shp2img.exe -m hampshire.map -o hampshire.png -s 2048 2048

I am using this URL scheme:
http://localhost:8088/cgi-bin/mapserv.exe?map=C:/ms4w/apps/gmap/htdocs/hampshire.map &layers=HampshireAreas&mode=tile&tilemode=gmap&tile=[x]+[y]+[z]

I have attached all the relevant files. (2 sets, one is .SHP and the other is .GML, both cases I get transparent empty tiles)

Can anyone please help me identify the reason why the generated tiles are transparent and how I can fix it.

(7MB total, 1MB pieces, sorry if this is large, I am new to mailing lists too, please use 7Z to unzip)
SHP: Hampshire.map Hampshire.7z.001 Hampshire.7z.002 Hampshire.7z.003 Hampshire.7z.004 Hampshire.7z.005 Hampshire.7z.006
GML: Hampshire-gml.map Hampshire-gml.7z

Alternate download (zip format, 14mb) http://www.megaupload.com/?d=DAD6SR5P

Thanks you very much.

Vaibhav G
Reply | Threaded
Open this post in threaded view
|

Re: Getting blank tiles in google maps

vaibhavgarg
Hello everyone,

I havent recieved any replies in few days. Please let me know what more info i can provide to explain better?

Thanks you.

Original question:
http://osgeo-org.1803224.n2.nabble.com/Getting-blank-tiles-in-google-maps-td6746323.html

================================================
Getting blank tiles in google maps
================================================
Aug 31, 2011; 6:04pm — by   vaibhavgarg
Hi all, I am new to MapServer.

I have downloaded and setup MS4W and was able to overlay the example Bath and other map data on google maps.

I then created my own .map file using QGIS and supplied my data but the served tiles are completely blank(transparant or white when I select RGB).

My data set is .GML and I also tried converting it to .SHP format. I have checked that my setup is ok by doing is on two different computers.

When I use shp2img.exe then it renders the layers properly.
c:\> shp2img.exe -m hampshire.map -o hampshire.png -s 2048 2048

I am using this URL scheme:
http://localhost:8088/cgi-bin/mapserv.exe?map=C:/ms4w/apps/gmap/htdocs/hampshire.map &layers=HampshireAreas&mode=tile&tilemode=gmap&tile=[x]+[y]+[z]

I have attached all the relevant files. (2 sets, one is .SHP and the other is .GML, both cases I get transparent empty tiles)

Can anyone please help me identify the reason why the generated tiles are transparent and how I can fix it.

(7MB total, 1MB pieces, sorry if this is large, I am new to mailing lists too, please use 7Z to unzip)
SHP: Hampshire.map Hampshire.7z.001 Hampshire.7z.002 Hampshire.7z.003 Hampshire.7z.004 Hampshire.7z.005 Hampshire.7z.006
GML: Hampshire-gml.map Hampshire-gml.7z

Alternate download (zip format, 14mb) http://www.megaupload.com/?d=DAD6SR5P 

Thanks you very much.

Vaibhav G
Reply | Threaded
Open this post in threaded view
|

Re: Getting blank tiles in google maps

Brent Fraser
Vaibhav,

   There's a bug in QGIS mapserver export with the Projection definition.   If your target (map) projection is really longlat you need to have

  UNITS DD
  EXTENT ? ? ? ?
  PROJECTION
    'proj=longlat'
    'ellps=WGS84'
    'towgs84=0,0,0,0,0,0,0'
    'no_defs'
  END

and change the above "?" to valid min/max lat/lon in decimal degrees.

Or change the PROJECTION to your projection.

You should post the question to the mapserver email list.
Best Regards,
Brent Fraser

On 9/8/2011 8:23 AM, vaibhavgarg wrote:
Hello everyone, 

I havent recieved any replies in few days. Please let me know what more info
i can provide to explain better?

Thanks you. 

Original question:
http://osgeo-org.1803224.n2.nabble.com/Getting-blank-tiles-in-google-maps-td6746323.html

================================================
Getting blank tiles in google maps
================================================
Aug 31, 2011; 6:04pm — by   vaibhavgarg
Hi all, I am new to MapServer.

I have downloaded and setup MS4W and was able to overlay the example Bath
and other map data on google maps.

I then created my own .map file using QGIS and supplied my data but the
served tiles are completely blank(transparant or white when I select RGB).

My data set is .GML and I also tried converting it to .SHP format. I have
checked that my setup is ok by doing is on two different computers.

When I use shp2img.exe then it renders the layers properly.
c:\> shp2img.exe -m hampshire.map -o hampshire.png -s 2048 2048

I am using this URL scheme:
http://localhost:8088/cgi-bin/mapserv.exe?map=C:/ms4w/apps/gmap/htdocs/hampshire.map
&layers=HampshireAreas&mode=tile&tilemode=gmap&tile=[x]+[y]+[z]

I have attached all the relevant files. (2 sets, one is .SHP and the other
is .GML, both cases I get transparent empty tiles)

Can anyone please help me identify the reason why the generated tiles are
transparent and how I can fix it.

(7MB total, 1MB pieces, sorry if this is large, I am new to mailing lists
too, please use 7Z to unzip)
SHP: Hampshire.map Hampshire.7z.001 Hampshire.7z.002 Hampshire.7z.003
Hampshire.7z.004 Hampshire.7z.005 Hampshire.7z.006 
GML: Hampshire-gml.map Hampshire-gml.7z 

Alternate download (zip format, 14mb) http://www.megaupload.com/?d=DAD6SR5P 

Thanks you very much.

Vaibhav G


--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Getting-blank-tiles-in-google-maps-tp6746323p6772023.html
Sent from the ms4w-users mailing list archive at Nabble.com.
_______________________________________________
MS4W-Users mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/ms4w-users

_______________________________________________
MS4W-Users mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/ms4w-users
Reply | Threaded
Open this post in threaded view
|

Re: Getting blank tiles in google maps

vaibhavgarg
Thanks for your reply. I will post in the mapserver list.

Can you help me in identifying the right projection types? (extents are easy but not the rest)

The example data is attached to the first message, which I am hoping is helpful. I am not so well versed in projections and it is only part I am having trouble with.

With regards,

Vaibhav G

Reply | Threaded
Open this post in threaded view
|

Re: Getting blank tiles in google maps

Brent Fraser
If your intent is to use Google Maps as a backdrop, your target map projection must be Spherical Mercator.  There are a few ways to specify this; here's one way:

MAP
   :
  PROJECTION
      "proj=merc"
      "a=6378137"
      "b=6378137"
      "lat_ts=0.0"
      "lon_0=0.0"
      "x_0=0.0"
      "y_0=0"
      "k=1.0"
      "units=m"
      "nadgrids=@null"
      "no_defs"
  END

Next you must tell mapserver the coordinate system of each of the source layers.  It looks like your layers are in "British National Grid" so use:

  LAYER
    :
      PROJECTION
           "EPSG:27700"
      END
   
Best Regards,
Brent Fraser

On 9/8/2011 11:18 AM, vaibhavgarg wrote:
Thanks for your reply. I will post in the mapserver list.

Can you help me in identifying the right projection types? (extents are easy
but not the rest)

The example data is attached to the first message, which I am hoping is
helpful. I am not so well versed in projections and it is only part I am
having trouble with.

With regards,

Vaibhav G



--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Getting-blank-tiles-in-google-maps-tp6746323p6772798.html
Sent from the ms4w-users mailing list archive at Nabble.com.
_______________________________________________
MS4W-Users mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/ms4w-users


_______________________________________________
MS4W-Users mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/ms4w-users
Reply | Threaded
Open this post in threaded view
|

Re: Getting blank tiles in google maps

vaibhavgarg
Yes I want to use google maps as a backdrop.

When I set the projections i get a projection library error:

msProcessProjection(): Projection library error. projection not named msOutputFormatValidate(): General error message. OUTPUTFORMAT png has IMAGEMODE RGB/RGBA, which is not supported for GD drivers.

It doesnt understand "EPSG:27700"
Reply | Threaded
Open this post in threaded view
|

Re: Getting blank tiles in google maps

Brent Fraser
Ok, that means taht the "common" EPSG alias is not known.  So use

PROJECTION
	"proj=tmerc"
	"lat_0=49"
	"lon_0=-2"
	"k=0.9996012717"
	"x_0=400000"
	"y_0=-100000"
	"ellps=airy"
	"datum=OSGB36"
	"units=m"
	"no_defs"
END
instead.

As for the other error, have a look at the online mapserver doc on output formats.

Best Regards,
Brent Fraser

On 9/8/2011 1:59 PM, vaibhavgarg wrote:
Yes I want to use google maps as a backdrop.

When I set the projections i get a projection library error:

msProcessProjection(): Projection library error. projection not named
msOutputFormatValidate(): General error message. OUTPUTFORMAT png has
IMAGEMODE RGB/RGBA, which is not supported for GD drivers.

It doesnt understand "EPSG:27700"

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Getting-blank-tiles-in-google-maps-tp6746323p6773517.html
Sent from the ms4w-users mailing list archive at Nabble.com.
_______________________________________________
MS4W-Users mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/ms4w-users


_______________________________________________
MS4W-Users mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/ms4w-users
Reply | Threaded
Open this post in threaded view
|

Re: Getting blank tiles in google maps

vaibhavgarg
Ok now it is back to the empty tiles.. here is what the map file looks like:
That other error shows up anytime I specify a unknown projection..a side product maybe.


MAP
  NAME WMS_Server
  SIZE 256 256
  UNITS dd
  EXTENT -2.290993 50.833757 -1.766036 51.105957
  FONTSET '../etc/fonts.txt'
  SYMBOLSET '../etc/symbols.txt'
  STATUS ON
  PROJECTION
      "proj=merc"
      "a=6378137"
      "b=6378137"
      "lat_ts=0.0"
      "lon_0=0.0"
      "x_0=0.0"
      "y_0=0"
      "k=1.0"
      "units=m"
      "nadgrids=@null"
      "no_defs"
  END
  IMAGECOLOR 255 255 255
  IMAGEQUALITY 95
  IMAGETYPE png
  OUTPUTFORMAT
    NAME png
    DRIVER 'GD/PNG'
    MIMETYPE 'image/png'
    IMAGEMODE RGB
    EXTENSION 'png'
  END

  WEB
    IMAGEPATH '/tmp/ms_tmp/'
    IMAGEURL '/tmp/'
    METADATA
      'wms_title'           'Hampshire'
      'wms_onlineresource'  'http://localhost:8088/cgi-bin/mapserv.exe?map=C:/ms4w/apps/gmap/htdocs/hampshire.map'
      'wms_srs'             'EPSG:4326'
      'wms_enable_request'  '*'
    END
    TEMPLATE 'fooOnlyForWMSGetFeatureInfo'
  END

  LAYER
    NAME 'HampshireAreas'
    TYPE POLYGON
	DEBUG ON
    TEMPLATE fooOnlyForWMSGetFeatureInfo
    EXTENT -2.290993 50.833757 -1.766036 51.105957
    DATA 'C:/ms4w/apps/gmap/data/HampshireAreas.shp'
    METADATA
      'wms_title' 'HampshireAreas'
    END
    PROJECTION
	"proj=tmerc"
	"lat_0=49"
	"lon_0=-2"
	"k=0.9996012717"
	"x_0=400000"
	"y_0=-100000"
	"ellps=airy"
	"datum=OSGB36"
	"units=m"
	"no_defs"
    END
    STATUS DEFAULT
    CLASS
       NAME 'HampshireAreas'
       STYLE
         WIDTH 0.91
         OUTLINECOLOR 0 0 0
         COLOR 73 135 43
       END
    END
  END
END
Reply | Threaded
Open this post in threaded view
|

Re: Getting blank tiles in google maps

Brent Fraser
Your extents and units are wrong.  They must be valid for the projection specified.  Change to

UNITS METERS

and remove the LAYER EXTENTS.
Best Regards,
Brent Fraser

On 9/8/2011 2:20 PM, vaibhavgarg wrote:
Ok now it is back to the empty tiles.. here is what the map file looks like:
That other error shows up anytime I specify a unknown projection..a side product maybe.


MAP
  NAME WMS_Server
  SIZE 256 256
  UNITS dd
  EXTENT -2.290993 50.833757 -1.766036 51.105957
  FONTSET '../etc/fonts.txt'
  SYMBOLSET '../etc/symbols.txt'
  STATUS ON
  PROJECTION
      "proj=merc"
      "a=6378137"
      "b=6378137"
      "lat_ts=0.0"
      "lon_0=0.0"
      "x_0=0.0"
      "y_0=0"
      "k=1.0"
      "units=m"
      "nadgrids=@null"
      "no_defs"
  END
  IMAGECOLOR 255 255 255
  IMAGEQUALITY 95
  IMAGETYPE png
  OUTPUTFORMAT
    NAME png
    DRIVER 'GD/PNG'
    MIMETYPE 'image/png'
    IMAGEMODE RGB
    EXTENSION 'png'
  END

  WEB
    IMAGEPATH '/tmp/ms_tmp/'
    IMAGEURL '/tmp/'
    METADATA
      'wms_title'           'Hampshire'
      'wms_onlineresource'  'http://localhost:8088/cgi-bin/mapserv.exe?map=C:/ms4w/apps/gmap/htdocs/hampshire.map'
      'wms_srs'             'EPSG:4326'
      'wms_enable_request'  '*'
    END
    TEMPLATE 'fooOnlyForWMSGetFeatureInfo'
  END

  LAYER
    NAME 'HampshireAreas'
    TYPE POLYGON
	DEBUG ON
    TEMPLATE fooOnlyForWMSGetFeatureInfo
    EXTENT -2.290993 50.833757 -1.766036 51.105957
    DATA 'C:/ms4w/apps/gmap/data/HampshireAreas.shp'
    METADATA
      'wms_title' 'HampshireAreas'
    END
    PROJECTION
	"proj=tmerc"
	"lat_0=49"
	"lon_0=-2"
	"k=0.9996012717"
	"x_0=400000"
	"y_0=-100000"
	"ellps=airy"
	"datum=OSGB36"
	"units=m"
	"no_defs"
    END
    STATUS DEFAULT
    CLASS
       NAME 'HampshireAreas'
       STYLE
         WIDTH 0.91
         OUTLINECOLOR 0 0 0
         COLOR 73 135 43
       END
    END
  END
END


View this message in context: Re: Getting blank tiles in google maps
Sent from the ms4w-users mailing list archive at Nabble.com.


_______________________________________________
MS4W-Users mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/ms4w-users

_______________________________________________
MS4W-Users mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/ms4w-users
Reply | Threaded
Open this post in threaded view
|

Re: Getting blank tiles in google maps

vaibhavgarg
woohooo High Five!

The map renders now and I am glad to have reached the first step. 

For this project the end requirements are rather complex and I am bound to have trouble due to lack of knowledge and difficultly in finding information online.

Can you give me some advice on how to learn more about Projections and GIS is general, books, online resources etc as I look forward to doing a lot more mapping work.


Thanks once again Brent.

Warm regards,
Vaibhav G


On Fri, Sep 9, 2011 at 1:55 AM, Brent Fraser [via OSGeo.org] <[hidden email]> wrote:
Your extents and units are wrong.  They must be valid for the projection specified.  Change to

UNITS METERS

and remove the LAYER EXTENTS.
Best Regards,
Brent Fraser

On 9/8/2011 2:20 PM, vaibhavgarg wrote:
Ok now it is back to the empty tiles.. here is what the map file looks like:
That other error shows up anytime I specify a unknown projection..a side product maybe.


MAP
  NAME WMS_Server
  SIZE 256 256
  UNITS dd
  EXTENT -2.290993 50.833757 -1.766036 51.105957
  FONTSET '../etc/fonts.txt'
  SYMBOLSET '../etc/symbols.txt'
  STATUS ON
  PROJECTION
      "proj=merc"
      "a=6378137"
      "b=6378137"
      "lat_ts=0.0"
      "lon_0=0.0"
      "x_0=0.0"
      "y_0=0"
      "k=1.0"
      "units=m"
      "nadgrids=@null"
      "no_defs"
  END
  IMAGECOLOR 255 255 255
  IMAGEQUALITY 95
  IMAGETYPE png
  OUTPUTFORMAT
    NAME png
    DRIVER 'GD/PNG'
    MIMETYPE 'image/png'
    IMAGEMODE RGB
    EXTENSION 'png'
  END

  WEB
    IMAGEPATH '/tmp/ms_tmp/'
    IMAGEURL '/tmp/'
    METADATA
      'wms_title'           'Hampshire'
      'wms_onlineresource'  'http://localhost:8088/cgi-bin/mapserv.exe?map=C:/ms4w/apps/gmap/htdocs/hampshire.map'
      'wms_srs'             'EPSG:4326'
      'wms_enable_request'  '*'
    END
    TEMPLATE 'fooOnlyForWMSGetFeatureInfo'
  END

  LAYER
    NAME 'HampshireAreas'
    TYPE POLYGON
	DEBUG ON
    TEMPLATE fooOnlyForWMSGetFeatureInfo
    EXTENT -2.290993 50.833757 -1.766036 51.105957
    DATA 'C:/ms4w/apps/gmap/data/HampshireAreas.shp'
    METADATA
      'wms_title' 'HampshireAreas'
    END
    PROJECTION
	"proj=tmerc"
	"lat_0=49"
	"lon_0=-2"
	"k=0.9996012717"
	"x_0=400000"
	"y_0=-100000"
	"ellps=airy"
	"datum=OSGB36"
	"units=m"
	"no_defs"
    END
    STATUS DEFAULT
    CLASS
       NAME 'HampshireAreas'
       STYLE
         WIDTH 0.91
         OUTLINECOLOR 0 0 0
         COLOR 73 135 43
       END
    END
  END
END


View this message in context: Re: Getting blank tiles in google maps

Sent from the ms4w-users mailing list archive at Nabble.com.


_______________________________________________
MS4W-Users mailing list
[hidden email]

_______________________________________________
MS4W-Users mailing list
[hidden email]

If you reply to this email, your message will be added to the discussion below:
http://osgeo-org.1803224.n2.nabble.com/Getting-blank-tiles-in-google-maps-tp6746323p6773619.html
To unsubscribe from Getting blank tiles in google maps, click here.

Reply | Threaded
Open this post in threaded view
|

Re: Getting blank tiles in google maps

Brent Fraser
Have a look at GeoMoose.org for a sample application.  Go to osgeo.org for general info on Open Source GIS.  Get Tyler Mitchel's book "Web Mapping Illustrated".

Good Luck!
Best Regards,
Brent Fraser

On 9/8/2011 11:58 PM, vaibhavgarg wrote:
woohooo High Five!

The map renders now and I am glad to have reached the first step. 

For this project the end requirements are rather complex and I am bound to have trouble due to lack of knowledge and difficultly in finding information online.

Can you give me some advice on how to learn more about Projections and GIS is general, books, online resources etc as I look forward to doing a lot more mapping work.


Thanks once again Brent.

Warm regards,
Vaibhav G


On Fri, Sep 9, 2011 at 1:55 AM, Brent Fraser [via OSGeo.org] <[hidden email]> wrote:
Your extents and units are wrong.  They must be valid for the projection specified.  Change to

UNITS METERS

and remove the LAYER EXTENTS.
Best Regards,
Brent Fraser

On 9/8/2011 2:20 PM, vaibhavgarg wrote:
Ok now it is back to the empty tiles.. here is what the map file looks like:
That other error shows up anytime I specify a unknown projection..a side product maybe.


MAP
  NAME WMS_Server
  SIZE 256 256
  UNITS dd
  EXTENT -2.290993 50.833757 -1.766036 51.105957
  FONTSET '../etc/fonts.txt'
  SYMBOLSET '../etc/symbols.txt'
  STATUS ON
  PROJECTION
      "proj=merc"
      "a=6378137"
      "b=6378137"
      "lat_ts=0.0"
      "lon_0=0.0"
      "x_0=0.0"
      "y_0=0"
      "k=1.0"
      "units=m"
      "nadgrids=@null"
      "no_defs"
  END
  IMAGECOLOR 255 255 255
  IMAGEQUALITY 95
  IMAGETYPE png
  OUTPUTFORMAT
    NAME png
    DRIVER 'GD/PNG'
    MIMETYPE 'image/png'
    IMAGEMODE RGB
    EXTENSION 'png'
  END

  WEB
    IMAGEPATH '/tmp/ms_tmp/'
    IMAGEURL '/tmp/'
    METADATA
      'wms_title'           'Hampshire'
      'wms_onlineresource'  'http://localhost:8088/cgi-bin/mapserv.exe?map=C:/ms4w/apps/gmap/htdocs/hampshire.map'
      'wms_srs'             'EPSG:4326'
      'wms_enable_request'  '*'
    END
    TEMPLATE 'fooOnlyForWMSGetFeatureInfo'
  END

  LAYER
    NAME 'HampshireAreas'
    TYPE POLYGON
	DEBUG ON
    TEMPLATE fooOnlyForWMSGetFeatureInfo
    EXTENT -2.290993 50.833757 -1.766036 51.105957
    DATA 'C:/ms4w/apps/gmap/data/HampshireAreas.shp'
    METADATA
      'wms_title' 'HampshireAreas'
    END
    PROJECTION
	"proj=tmerc"
	"lat_0=49"
	"lon_0=-2"
	"k=0.9996012717"
	"x_0=400000"
	"y_0=-100000"
	"ellps=airy"
	"datum=OSGB36"
	"units=m"
	"no_defs"
    END
    STATUS DEFAULT
    CLASS
       NAME 'HampshireAreas'
       STYLE
         WIDTH 0.91
         OUTLINECOLOR 0 0 0
         COLOR 73 135 43
       END
    END
  END
END


View this message in context: Re: Getting blank tiles in google maps

Sent from the ms4w-users mailing list archive at Nabble.com.


_______________________________________________
MS4W-Users mailing list
[hidden email]

_______________________________________________
MS4W-Users mailing list
[hidden email]

If you reply to this email, your message will be added to the discussion below:
http://osgeo-org.1803224.n2.nabble.com/Getting-blank-tiles-in-google-maps-tp6746323p6773619.html
To unsubscribe from Getting blank tiles in google maps, click here.



View this message in context: Re: Getting blank tiles in google maps
Sent from the ms4w-users mailing list archive at Nabble.com.


_______________________________________________
MS4W-Users mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/ms4w-users

_______________________________________________
MS4W-Users mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/ms4w-users