[mapserver-users] Contents of mapserver-users digest

Muammar (Mario) Manzanares marman_8587 at yahoo.com
Wed Jan 20 09:54:21 PST 2010


----- Original Message ----
From: "mapserver-users-request at lists.osgeo.org" <mapserver-users-request at lists.osgeo.org>
To: mapserver-users at lists.osgeo.org
Sent: Wed, January 20, 2010 12:45:25 PM
Subject: mapserver-users Digest, Vol 24, Issue 63

Send mapserver-users mailing list submissions to
    mapserver-users at lists.osgeo.org

To subscribe or unsubscribe via the World Wide Web, visit
    http://lists.osgeo.org/mailman/listinfo/mapserver-users
or, via email, send a message with subject or body 'help' to
    mapserver-users-request at lists.osgeo.org

You can reach the person managing the list at
    mapserver-users-owner at lists.osgeo.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of mapserver-users digest..."


Today's Topics:

  1. RE: RE: Images returning blank (Fawcett, David (MPCA))
  2. RE: RE: Images returning blank (Kent Morrison)
  3. Contents of mapserver-users digest (Muammar (Mario) Manzanares)


----------------------------------------------------------------------

Message: 1
Date: Wed, 20 Jan 2010 11:05:36 -0600
From: "Fawcett, David (MPCA)" <David.Fawcett at state.mn.us>
Subject: RE: [mapserver-users] RE: Images returning blank
To: Kent Morrison <KMorrison at advantrack.com>,    'Rahkonen Jukka'
    <Jukka.Rahkonen at mmmtike.fi>,    "mapserver-users at lists.osgeo.org"
    <mapserver-users at lists.osgeo.org>
Message-ID:
    <D2C2A8AE8E016C42A974F644AF21E13902F592B6CA at MNMAIL05.ead.state.mn.us>
Content-Type: text/plain; charset="iso-8859-1"

If you were just trying to display the data in a simple map, you could go without the projection info and still see something if you only wanted to display that layer.

Let's add a PROJECTION obj to your layer:

Take a look at http://spatialreference.org/ref/esri/102740/.  I am pretty sure that this is the spatial reference system (SRS) that your data is in.  

MapServer uses SRS definitions in Proj.4 format.  Here is a link to this SRS in Proj.4:  http://spatialreference.org/ref/esri/102740/proj4/

In your LAYER, add

PROJECTION
  "proj=lcc"
  "lat_1=28.38333333333333"
  "lat_2=30.28333333333334"
  "lat_0=27.83333333333333"
  "lon_0=-99" 
  "x_0=600000.0000000001"
  "y_0=4000000"
  "ellps=GRS80"
  "datum=NAD83"
  "to_meter=0.3048006096012192"
  "no_defs"
END

Does this work?

David.

-----Original Message-----
From: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Kent Morrison
Sent: Wednesday, January 20, 2010 10:45 AM
To: 'Rahkonen Jukka'; mapserver-users at lists.osgeo.org
Subject: RE: [mapserver-users] RE: Images returning blank

Removing the PROJECTION from the trafficflow_2007 map results in the following error:

Cannot set new SRS on a map that doesn't have any projection set. Please make sure your mapfile has a PROJECTION defined at the top level.

So what I need to do is figure out how to setup the PROJECTION. Which I have no idea on.

The .prj file that can with the shp file is:

PROJCS["NAD_1983_StatePlane_Texas_South_Central_FIPS_4204_Feet",
    GEOGCS["GCS_North_American_1983",
        DATUM["D_North_American_1983",
        SPHEROID["GRS_1980",6378137.0,298.257222101]],
        PRIMEM["Greenwich",0.0],
        UNIT["Degree",0.0174532925199433]],

    PROJECTION["Lambert_Conformal_Conic"],
    PARAMETER["False_Easting",1968500.0],
    PARAMETER["False_Northing",13123333.33333333],
    PARAMETER["Central_Meridian",-99.0],
    PARAMETER["Standard_Parallel_1",28.38333333333333],
    PARAMETER["Standard_Parallel_2",30.28333333333334],
    PARAMETER["Latitude_Of_Origin",27.83333333333333],
    UNIT["Foot_US",0.3048006096012192]]


So now I am trying to figure out PROJECTIONS... Any suggestions or sites with examples that will help me here would be greatly appreciated.

Thanks
Kent 

-----Original Message-----
From: Rahkonen Jukka [mailto:Jukka.Rahkonen at mmmtike.fi] 
Sent: Tuesday, January 19, 2010 4:25 PM
To: Kent Morrison; mapserver-users at lists.osgeo.org
Subject: Re: [mapserver-users] RE: Images returning blank

Hi,

The non-working one is in some other projection than epsg:4326. You will get that layer visible by removing projection also from the MAP level and using the extents from ogrinfo, but in order to show both layers together you should know the correct projection for both datasets.
If projection is given at map level it must suit the extents.  Epsg:4326 and EXTENT 2460247.751004 232706.929725 2507483.898985 294550.472704 do not suit.

-Jukka-



-----Alkuperäinen viesti-----
Lähettäjä: mapserver-users-bounces at lists.osgeo.org puolesta: Kent Morrison
Lähetetty: ke 20.1.2010 0:14
Vastaanottaja: 'Fawcett, David (MPCA)'; 'mapserver-users at lists.osgeo.org'
Aihe: [mapserver-users] RE: Images returning blank

I ran ogrinfo.exe on the non-working file.

C:\ms4w\tools\gdal-ogr>ogrinfo.exe c:\mapserverdata\shapefiles\1\trafficflow_200
7.shp trafficflow_2007 -so
INFO: Open of `c:\mapserverdata\shapefiles\1\trafficflow_2007.shp'
      using driver `ESRI Shapefile' successful.

Layer name: trafficflow_2007
Geometry: Line String
Feature Count: 4212
Extent: (2460247.751004, 232706.929725) - (2507483.898985, 294550.472704) Layer SRS WKT:
(unknown)
CounterID: Integer (10.0)
Location: String (50.0)
StartDate: Date (10.0)
ADT_Total: Integer (10.0)
AWD_Total: Integer (10.0)
XCoord: Real (19.8)
YCoord: Real (19.8)
StreetID: String (16.0)
Shape_len: Real (19.11)


I added:

EXTENT 2460247.751004 232706.929725 2507483.898985 294550.472704

to the map file and changed the Layer Status to Default.

[Tue Jan 19 21:43:35 2010].791000 CGI Request 1 on process 2676 [Tue Jan 19 21:43:35 2010].791000 msTileSetExtent (-13073784.538762, 6051371.431753) (-13071348.108486, 6053807.862029) [Tue Jan 19 21:43:35 2010].791000 msDrawMap(): Layer 0 (SpokaneTrafficFlows), 0.000s [Tue Jan 19 21:43:35 2010].791000 msDrawMap(): Drawing Label Cache, 0.000s [Tue Jan 19 21:43:35 2010].791000 msDrawMap() total time: 0.000s [Tue Jan 19 21:43:35 2010].822000 msSaveImage() total time: 0.031s [Tue Jan 19 21:43:35 2010].822000 mapserv request processing time (loadmap not incl.): 0.031s [Tue Jan 19 21:43:35 2010].822000 msFreeMap(): freeing map at 01A5AF10.

Still a blank image.

When I ran ogrinfo.exe on the working shapefile:


C:\ms4w\tools\gdal-ogr>ogrinfo.exe c:\mapserverdata\shapefiles\1\co48_d00.shp -s o co48_d00
INFO: Open of `c:\mapserverdata\shapefiles\1\co48_d00.shp'
      using driver `ESRI Shapefile' successful.

Layer name: co48_d00
Geometry: Polygon
Feature Count: 265
Extent: (-106.645646, 25.837377) - (-93.516407, 36.500704) Layer SRS WKT:
(unknown)
AREA: Real (20.5)
PERIMETER: Real (20.5)
CO48_D00_: Real (11.0)
CO48_D00_I: Real (11.0)
STATE: String (2.0)
COUNTY: String (3.0)
NAME: String (90.0)
LSAD: String (2.0)
LSAD_TRANS: String (50.0)


The Extents on the working file are in lat/lon. In the non-working file it looks to be in something else.

I'm trying to return VE image tiles..

not sure where to go from here to get the first file to work.

Thanks

________________________________
From: Fawcett, David (MPCA) [mailto:David.Fawcett at state.mn.us]
Sent: Tuesday, January 19, 2010 3:28 PM
To: Kent Morrison; 'mapserver-users at lists.osgeo.org'
Subject: RE: Images returning blank



Based on the errors, it looks like you will need EXTENT to your map file at the MAP level.

What do you get when you run ogrinfo against the two shapefiles?  Any difference?

Are you adding a URL var for the layer name?  Try setting LAYER STATUS to DEFAULT for both layers and see if you get an image back.

David.

From: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Kent Morrison
Sent: Tuesday, January 19, 2010 3:17 PM
To: 'mapserver-users at lists.osgeo.org'
Subject: [mapserver-users] Images returning blank

I have mapserver 5.4.2 installed.

I have two different shape files, one renders properly the other only returns blank images

The debug log for the one that does not work returns:

[Tue Jan 19 20:34:59 2010].212000 CGI Request 1 on process 1180 [Tue Jan 19 20:34:59 2010].212000 mapserv(): Web application error. No way to generate map extent.
[Tue Jan 19 20:34:59 2010].212000 msCalculateScale(): General error message. Invalid image extent, minx=-1.000000, miny=-1.000000, maxx=-1.000000, maxy=-1.000000.
[Tue Jan 19 20:34:59 2010].212000 msTileSetExtent (-13090872.991896, 6046512.903143) (-13071381.549686, 6066004.345353) [Tue Jan 19 20:34:59 2010].227000 msDrawMap(): Layer 0 (SpokaneTrafficFlows), 0.000s [Tue Jan 19 20:34:59 2010].227000 msDrawMap(): Drawing Label Cache, 0.000s [Tue Jan 19 20:34:59 2010].227000 msDrawMap() total time: 0.015s [Tue Jan 19 20:34:59 2010].274000 msSaveImage() total time: 0.047s [Tue Jan 19 20:34:59 2010].274000 mapserv request processing time (loadmap not incl.): 0.062s [Tue Jan 19 20:34:59 2010].274000 msFreeMap(): freeing map at 01A5AF00.
[Tue Jan 19 20:34:59 2010].274000 freeLayer(): freeing layer at 020E4160.

the map file is:

MAP
    IMAGETYPE AGG
    SIZE 256 256
    SHAPEPATH "/MapServerData/ShapeFiles/1"
    IMAGECOLOR 255 255 255
    TRANSPARENT ON
    FONTSET "../../fonts/fonts.list"

CONFIG PROJ_LIB "c:\ms4w\proj\nad\"
CONFIG MS_ERRORFILE "c:\ms4w\tmp\errors2.txt"
DEBUG 5

    PROJECTION
        "init=epsg:4326"
    END

    OUTPUTFORMAT
        NAME 'AGG'
        DRIVER AGG/PNG
        IMAGEMODE RGB
    END #Outputformat

    LAYER
        NAME SpokaneTrafficFlows
        DATA TrafficFlow_2007
        STATUS ON
        TYPE LINE

        DEBUG 5

        CLASS
            NAME "classSpokaneTrafficFlows"

            STYLE
                COLOR 127 255 64
                OPACITY 50
                OUTLINECOLOR 255 128 64
                WIDTH 3
            END #style
        END #class
    END #layer
END #Map

running shp2img.exe returns:
msLoadMap(): Image handling error. Unable to initialize image
msCalculateScale(): General error message. invalid image extent ....

I get the same results for shp2img on the working shapefile/map file.


THE FOLLOWING WORKS:

MAP

  IMAGETYPE      AGG
  SIZE          256 256
  SHAPEPATH      "/MapServerData/ShapeFiles/1"
  IMAGECOLOR    255 255 255
  TRANSPARENT    ON
  FONTSET        "../../fonts/fonts.list"

CONFIG PROJ_LIB "c:\ms4w\proj\nad\"

  PROJECTION
    "init=epsg:4326"
  END

  OUTPUTFORMAT
    NAME 'AGG'
    DRIVER AGG/PNG
    IMAGEMODE RGB
  END #Outputformat

  LAYER
    NAME          TxCounties
    DATA  co48_d00
    STATUS      ON
    TYPE        Polygon

    CLASS
        NAME  "classTxCounties"

        STYLE
            COLOR        0 255 0
            OPACITY      25
            OUTLINECOLOR  0 0 0
            WIDTH      2
        END #style
    END #class
  END #layer
END #Map



Anyone have any idea's why this might not work in the first case? Or what else can I do to debug the problem?


Kent



_______________________________________________
mapserver-users mailing list
mapserver-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


------------------------------

Message: 2
Date: Wed, 20 Jan 2010 11:38:22 -0600
From: Kent Morrison <KMorrison at advantrack.com>
Subject: RE: [mapserver-users] RE: Images returning blank
To: "'Fawcett, David (MPCA)'" <David.Fawcett at state.mn.us>, 'Rahkonen
    Jukka'    <Jukka.Rahkonen at mmmtike.fi>, "mapserver-users at lists.osgeo.org"
    <mapserver-users at lists.osgeo.org>
Message-ID:
    <4DCDDD4507E4E847920443D1B98C588D04A5210B35 at mail1.advantrack.local>
Content-Type: text/plain; charset="iso-8859-1"

I am trying to display the data as a map layer that can overly a Vitural Earth map.

Some of my shape files that were not working before are now working where others are still not, but at least I now have a clue to what the heck I am doing!

I'll look at the links you sent me and try to figure out the other files.

Thanks!

Kent

-----Original Message-----
From: Fawcett, David (MPCA) [mailto:David.Fawcett at state.mn.us] 
Sent: Wednesday, January 20, 2010 11:06 AM
To: Kent Morrison; 'Rahkonen Jukka'; mapserver-users at lists.osgeo.org
Subject: RE: [mapserver-users] RE: Images returning blank

If you were just trying to display the data in a simple map, you could go without the projection info and still see something if you only wanted to display that layer.

Let's add a PROJECTION obj to your layer:

Take a look at http://spatialreference.org/ref/esri/102740/.  I am pretty sure that this is the spatial reference system (SRS) that your data is in.  

MapServer uses SRS definitions in Proj.4 format.  Here is a link to this SRS in Proj.4:  http://spatialreference.org/ref/esri/102740/proj4/

In your LAYER, add

PROJECTION
  "proj=lcc"
  "lat_1=28.38333333333333"
  "lat_2=30.28333333333334"
  "lat_0=27.83333333333333"
  "lon_0=-99" 
  "x_0=600000.0000000001"
  "y_0=4000000"
  "ellps=GRS80"
  "datum=NAD83"
  "to_meter=0.3048006096012192"
  "no_defs"
END

Does this work?

David.

-----Original Message-----
From: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Kent Morrison
Sent: Wednesday, January 20, 2010 10:45 AM
To: 'Rahkonen Jukka'; mapserver-users at lists.osgeo.org
Subject: RE: [mapserver-users] RE: Images returning blank

Removing the PROJECTION from the trafficflow_2007 map results in the following error:

Cannot set new SRS on a map that doesn't have any projection set. Please make sure your mapfile has a PROJECTION defined at the top level.

So what I need to do is figure out how to setup the PROJECTION. Which I have no idea on.

The .prj file that can with the shp file is:

PROJCS["NAD_1983_StatePlane_Texas_South_Central_FIPS_4204_Feet",
    GEOGCS["GCS_North_American_1983",
        DATUM["D_North_American_1983",
        SPHEROID["GRS_1980",6378137.0,298.257222101]],
        PRIMEM["Greenwich",0.0],
        UNIT["Degree",0.0174532925199433]],

    PROJECTION["Lambert_Conformal_Conic"],
    PARAMETER["False_Easting",1968500.0],
    PARAMETER["False_Northing",13123333.33333333],
    PARAMETER["Central_Meridian",-99.0],
    PARAMETER["Standard_Parallel_1",28.38333333333333],
    PARAMETER["Standard_Parallel_2",30.28333333333334],
    PARAMETER["Latitude_Of_Origin",27.83333333333333],
    UNIT["Foot_US",0.3048006096012192]]


So now I am trying to figure out PROJECTIONS... Any suggestions or sites with examples that will help me here would be greatly appreciated.

Thanks
Kent 

-----Original Message-----
From: Rahkonen Jukka [mailto:Jukka.Rahkonen at mmmtike.fi]
Sent: Tuesday, January 19, 2010 4:25 PM
To: Kent Morrison; mapserver-users at lists.osgeo.org
Subject: Re: [mapserver-users] RE: Images returning blank

Hi,

The non-working one is in some other projection than epsg:4326. You will get that layer visible by removing projection also from the MAP level and using the extents from ogrinfo, but in order to show both layers together you should know the correct projection for both datasets.
If projection is given at map level it must suit the extents.  Epsg:4326 and EXTENT 2460247.751004 232706.929725 2507483.898985 294550.472704 do not suit.

-Jukka-



-----Alkuperäinen viesti-----
Lähettäjä: mapserver-users-bounces at lists.osgeo.org puolesta: Kent Morrison
Lähetetty: ke 20.1.2010 0:14
Vastaanottaja: 'Fawcett, David (MPCA)'; 'mapserver-users at lists.osgeo.org'
Aihe: [mapserver-users] RE: Images returning blank

I ran ogrinfo.exe on the non-working file.

C:\ms4w\tools\gdal-ogr>ogrinfo.exe c:\mapserverdata\shapefiles\1\trafficflow_200
7.shp trafficflow_2007 -so
INFO: Open of `c:\mapserverdata\shapefiles\1\trafficflow_2007.shp'
      using driver `ESRI Shapefile' successful.

Layer name: trafficflow_2007
Geometry: Line String
Feature Count: 4212
Extent: (2460247.751004, 232706.929725) - (2507483.898985, 294550.472704) Layer SRS WKT:
(unknown)
CounterID: Integer (10.0)
Location: String (50.0)
StartDate: Date (10.0)
ADT_Total: Integer (10.0)
AWD_Total: Integer (10.0)
XCoord: Real (19.8)
YCoord: Real (19.8)
StreetID: String (16.0)
Shape_len: Real (19.11)


I added:

EXTENT 2460247.751004 232706.929725 2507483.898985 294550.472704

to the map file and changed the Layer Status to Default.

[Tue Jan 19 21:43:35 2010].791000 CGI Request 1 on process 2676 [Tue Jan 19 21:43:35 2010].791000 msTileSetExtent (-13073784.538762, 6051371.431753) (-13071348.108486, 6053807.862029) [Tue Jan 19 21:43:35 2010].791000 msDrawMap(): Layer 0 (SpokaneTrafficFlows), 0.000s [Tue Jan 19 21:43:35 2010].791000 msDrawMap(): Drawing Label Cache, 0.000s [Tue Jan 19 21:43:35 2010].791000 msDrawMap() total time: 0.000s [Tue Jan 19 21:43:35 2010].822000 msSaveImage() total time: 0.031s [Tue Jan 19 21:43:35 2010].822000 mapserv request processing time (loadmap not incl.): 0.031s [Tue Jan 19 21:43:35 2010].822000 msFreeMap(): freeing map at 01A5AF10.

Still a blank image.

When I ran ogrinfo.exe on the working shapefile:


C:\ms4w\tools\gdal-ogr>ogrinfo.exe c:\mapserverdata\shapefiles\1\co48_d00.shp -s o co48_d00
INFO: Open of `c:\mapserverdata\shapefiles\1\co48_d00.shp'
      using driver `ESRI Shapefile' successful.

Layer name: co48_d00
Geometry: Polygon
Feature Count: 265
Extent: (-106.645646, 25.837377) - (-93.516407, 36.500704) Layer SRS WKT:
(unknown)
AREA: Real (20.5)
PERIMETER: Real (20.5)
CO48_D00_: Real (11.0)
CO48_D00_I: Real (11.0)
STATE: String (2.0)
COUNTY: String (3.0)
NAME: String (90.0)
LSAD: String (2.0)
LSAD_TRANS: String (50.0)


The Extents on the working file are in lat/lon. In the non-working file it looks to be in something else.

I'm trying to return VE image tiles..

not sure where to go from here to get the first file to work.

Thanks

________________________________
From: Fawcett, David (MPCA) [mailto:David.Fawcett at state.mn.us]
Sent: Tuesday, January 19, 2010 3:28 PM
To: Kent Morrison; 'mapserver-users at lists.osgeo.org'
Subject: RE: Images returning blank



Based on the errors, it looks like you will need EXTENT to your map file at the MAP level.

What do you get when you run ogrinfo against the two shapefiles?  Any difference?

Are you adding a URL var for the layer name?  Try setting LAYER STATUS to DEFAULT for both layers and see if you get an image back.

David.

From: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Kent Morrison
Sent: Tuesday, January 19, 2010 3:17 PM
To: 'mapserver-users at lists.osgeo.org'
Subject: [mapserver-users] Images returning blank

I have mapserver 5.4.2 installed.

I have two different shape files, one renders properly the other only returns blank images

The debug log for the one that does not work returns:

[Tue Jan 19 20:34:59 2010].212000 CGI Request 1 on process 1180 [Tue Jan 19 20:34:59 2010].212000 mapserv(): Web application error. No way to generate map extent.
[Tue Jan 19 20:34:59 2010].212000 msCalculateScale(): General error message. Invalid image extent, minx=-1.000000, miny=-1.000000, maxx=-1.000000, maxy=-1.000000.
[Tue Jan 19 20:34:59 2010].212000 msTileSetExtent (-13090872.991896, 6046512.903143) (-13071381.549686, 6066004.345353) [Tue Jan 19 20:34:59 2010].227000 msDrawMap(): Layer 0 (SpokaneTrafficFlows), 0.000s [Tue Jan 19 20:34:59 2010].227000 msDrawMap(): Drawing Label Cache, 0.000s [Tue Jan 19 20:34:59 2010].227000 msDrawMap() total time: 0.015s [Tue Jan 19 20:34:59 2010].274000 msSaveImage() total time: 0.047s [Tue Jan 19 20:34:59 2010].274000 mapserv request processing time (loadmap not incl.): 0.062s [Tue Jan 19 20:34:59 2010].274000 msFreeMap(): freeing map at 01A5AF00.
[Tue Jan 19 20:34:59 2010].274000 freeLayer(): freeing layer at 020E4160.

the map file is:

MAP
    IMAGETYPE AGG
    SIZE 256 256
    SHAPEPATH "/MapServerData/ShapeFiles/1"
    IMAGECOLOR 255 255 255
    TRANSPARENT ON
    FONTSET "../../fonts/fonts.list"

CONFIG PROJ_LIB "c:\ms4w\proj\nad\"
CONFIG MS_ERRORFILE "c:\ms4w\tmp\errors2.txt"
DEBUG 5

    PROJECTION
        "init=epsg:4326"
    END

    OUTPUTFORMAT
        NAME 'AGG'
        DRIVER AGG/PNG
        IMAGEMODE RGB
    END #Outputformat

    LAYER
        NAME SpokaneTrafficFlows
        DATA TrafficFlow_2007
        STATUS ON
        TYPE LINE

        DEBUG 5

        CLASS
            NAME "classSpokaneTrafficFlows"

            STYLE
                COLOR 127 255 64
                OPACITY 50
                OUTLINECOLOR 255 128 64
                WIDTH 3
            END #style
        END #class
    END #layer
END #Map

running shp2img.exe returns:
msLoadMap(): Image handling error. Unable to initialize image
msCalculateScale(): General error message. invalid image extent ....

I get the same results for shp2img on the working shapefile/map file.


THE FOLLOWING WORKS:

MAP

  IMAGETYPE      AGG
  SIZE          256 256
  SHAPEPATH      "/MapServerData/ShapeFiles/1"
  IMAGECOLOR    255 255 255
  TRANSPARENT    ON
  FONTSET        "../../fonts/fonts.list"

CONFIG PROJ_LIB "c:\ms4w\proj\nad\"

  PROJECTION
    "init=epsg:4326"
  END

  OUTPUTFORMAT
    NAME 'AGG'
    DRIVER AGG/PNG
    IMAGEMODE RGB
  END #Outputformat

  LAYER
    NAME          TxCounties
    DATA  co48_d00
    STATUS      ON
    TYPE        Polygon

    CLASS
        NAME  "classTxCounties"

        STYLE
            COLOR        0 255 0
            OPACITY      25
            OUTLINECOLOR  0 0 0
            WIDTH      2
        END #style
    END #class
  END #layer
END #Map



Anyone have any idea's why this might not work in the first case? Or what else can I do to debug the problem?


Kent



_______________________________________________
mapserver-users mailing list
mapserver-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


------------------------------

Message: 3
Date: Wed, 20 Jan 2010 09:38:38 -0800 (PST)
From: "Muammar \(Mario\) Manzanares" <marman_8587 at yahoo.com>
Subject: [mapserver-users] Contents of mapserver-users digest
To: mapserver-users at lists.osgeo.org
Message-ID: <77525.55811.qm at web35905.mail.mud.yahoo.com>
Content-Type: text/plain; charset=iso-8859-1

----- Original Message ----
From: "mapserver-users-request at lists.osgeo.org" <mapserver-users-request at lists.osgeo.org>
To: mapserver-users at lists.osgeo.org
Sent: Wed, January 20, 2010 11:45:39 AM
Subject: mapserver-users Digest, Vol 24, Issue 61

Send mapserver-users mailing list submissions to
    mapserver-users at lists.osgeo.org

To subscribe or unsubscribe via the World Wide Web, visit
    http://lists.osgeo.org/mailman/listinfo/mapserver-users
or, via email, send a message with subject or body 'help' to
    mapserver-users-request at lists.osgeo.org

You can reach the person managing the list at
    mapserver-users-owner at lists.osgeo.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of mapserver-users digest..."


Today's Topics:

  1. Re: PHP MapScript pixel coordinates to map    coordinates
      (Daniel Degasperi)
  2. Re: 5.6.1 Postgis problem (Sandeep Kumar Chauhan)
  3. VRT / CSV data sources are not displayed in a    layer
      (Stefan Schantz)
  4. Re: VRT / CSV data sources are not displayed in a    layer
      (Carlos Ruiz)
  5. Announcement: Dracones,    a web mapping framework for MapServer
      (Christian Jauvin)
  6. RE: RE: Images returning blank (Kent Morrison)


----------------------------------------------------------------------

Message: 1
Date: Wed, 20 Jan 2010 08:29:23 +0100
From: Daniel Degasperi <daniel.degasperi at r3-gis.com>
Subject: Re: [mapserver-users] PHP MapScript pixel coordinates to map
    coordinates
To: mapserver-users at lists.osgeo.org
Message-ID: <4B56B0D3.4000806 at r3-gis.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Hi David,

have you already tried with this conversion:

$geo_x = $minx + (($pix_x / $map_width) * ($maxx- $minx));
$geo_y = $maxy - (($pix_y / $map_height) * ($maxy - $miny));

Daniel

Am 20.01.2010 04:57, schrieb Shorthouse, David:
> Folks,
>
> This question has no doubt been asked many times, but for the life of
> me I cannot find a solution. Here's what I'm trying to do:
>
> I have a jQuery-based front-end that uses the wonderful jcrop
> extension (http://deepliquid.com/content/Jcrop.html) that helps
> coordinate zoom. I'm hoping to use this same front-end to permit
> cropping of a resultant map image, which means I need to pass the four
> pixel corner coordinates, convert to map coordinates (projection may
> be variable), then set the extent such that the resultant map image
> will have the same dimensions as that described by the user on the
> front-end. So, how can I convert pixel coordinates to map coordinates?
> Note that the map projection is not always DD so I cannot merely use
> proportions as I have seen in some solutions. Surely this is easier
> than I am making it out to be.
>
> Thanks for any advice,
>
> David Shorthouse
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>
>    


-- 
  Daniel Degasperi
  Software Developer
  daniel.degasperi at r3-gis.com

---------------------------
  R3 GIS Srl
  Via Johann Kravogl 2
  I-39010 Merano - Sinigo (BZ)
  Tel. +39 0473 494949
  Fax. +39 0473 069902
  Web  http://www.r3-gis.com
-----------------------------



------------------------------

Message: 2
Date: Wed, 20 Jan 2010 06:45:56 -0800 (PST)
From: Sandeep Kumar Chauhan <sandeepk.tech at gmail.com>
Subject: [mapserver-users] Re: 5.6.1 Postgis problem
To: mapserver-users at lists.osgeo.org
Message-ID: <1263998756968-4426856.post at n2.nabble.com>
Content-Type: text/plain; charset=us-ascii


Hi Steve,

Thanks for help, i changed my code according to your suggestion.

if (layer.queryByPoint(Map, point, (int)mapscript.MS_SINGLE, tolerance) ==
...
{
    resultCacheObj result = layer.getResults();
                    if (result.numresults > 0)
                    {
                        resultCacheMemberObj rrr = result.getResult(0);
                        shapeObj shape = new shapeObj((int)layer.type);
                        layer.resultsGetShape(shape, rrr.shapeindex,
rrr.tileindex);
                        ...
                        ...
                        ...
Now it is working fine. Again thanks for help

Thanks,
  -Sandeep 
-- 
View this message in context: http://n2.nabble.com/5-6-1-Postgis-problem-tp4392177p4426856.html
Sent from the Mapserver - User mailing list archive at Nabble.com.


------------------------------

Message: 3
Date: Wed, 20 Jan 2010 16:32:12 +0100
From: Stefan Schantz <SSchantz at BfS.de>
Subject: [mapserver-users] VRT / CSV data sources are not displayed in
    a    layer
To: mapserver-users at lists.osgeo.org
Message-ID: <4B5721FC.60608 at BfS.de>
Content-Type: text/plain; charset=ISO-8859-15; format=flowed

Hello List,

The following layer uses a CSV-file (together with a VRT-File (Virtual 
Format) ) as datasource . When I try to visualize the layer, nothing is 
shown (neither the data nor error messages; shp2img shows also nothing)

LAYER
    NAME "boden"
    DEBUG on
    STATUS ON
    TYPE POINT
# DATA "/daten/csv/boden/boden" # Datenquelle Shapefile
    CONNECTION  "/daten/csv/boden.vrt"
    CONNECTIONTYPE OGR

    PROJECTION
        "init=epsg:25832"
    END
      
    METADATA
        "WMS_TITLE"    "test"
        "WMS_SRS"  "EPSG:25832"
    "WMS_ABSTRACT"    "test"
        "WMS_FEATURE_INFO_MIME_TYPE" 'text/html'
    END

        CLASS
          NAME "test"
          STYLE
                SYMBOL "circle"
                SIZE 15  
                COLOR 90 90 90
          END
        END          
END


But if I transform the CSV/VRT-file into a Shapefile  via ogr2ogr

ogr2ogr -s_srs EPSG:25832 -t_srs EPSG:25832 -f "ESRI Shapefile" boden boden.vrt


the layer displays the data.
What is wrong with my VRT/CSV-datasource in the mapfile?

Thanks for any idea.

Best regards
Stefan


------------------------------

Message: 4
Date: Wed, 20 Jan 2010 08:20:10 -0800 (PST)
From: Carlos Ruiz <boolean10001 at yahoo.com>
Subject: Re: [mapserver-users] VRT / CSV data sources are not
    displayed in a    layer
To: Stefan Schantz <SSchantz at BfS.de>, mapserver-users at lists.osgeo.org
Message-ID: <785497.50057.qm at web38201.mail.mud.yahoo.com>
Content-Type: text/plain; charset="us-ascii"

Check that you have your CSV like this:

Lat,Lng,House
48.1,0.25,"My house"
49.2,1.1,"My girlfriend's house"
47.5,0.75,"My mother in law's house"

And that you have your VTR like this:

<OGRVRTDataSource>
<OGRVRTLayer name="neighborhood">
    <SrcDataSource>[FILE]</SrcDataSource>
    <GeometryType>wkbPoint</GeometryType>
    <LayerSRS>[YOUR SRS]</LayerSRS>
    <GeometryField encoding="PointFromColumns" x="Lng" y="Lat"/>
</OGRVRTLayer>
</OGRVRTDataSource>


IC Carlos Ruiz


________________________________
From: Stefan Schantz <SSchantz at BfS.de>
To: mapserver-users at lists.osgeo.org
Sent: Wed, January 20, 2010 9:32:12 AM
Subject: [mapserver-users] VRT / CSV data sources are not displayed in a layer

Hello List,

The following layer uses a CSV-file (together with a VRT-File (Virtual Format) ) as datasource . When I try to visualize the layer, nothing is shown (neither the data nor error messages; shp2img shows also nothing)

LAYER
  NAME "boden"
  DEBUG on
  STATUS ON
  TYPE POINT
# DATA "/daten/csv/boden/boden" # Datenquelle Shapefile
  CONNECTION  "/daten/csv/boden.vrt"
  CONNECTIONTYPE OGR

  PROJECTION
      "init=epsg:25832"
  END
        METADATA
      "WMS_TITLE"    "test"
      "WMS_SRS"  "EPSG:25832"
  "WMS_ABSTRACT"    "test"
      "WMS_FEATURE_INFO_MIME_TYPE" 'text/html'
  END

      CLASS
          NAME "test"
          STYLE
              SYMBOL "circle"
              SIZE 15                  COLOR 90 90 90
          END
      END          END


But if I transform the CSV/VRT-file into a Shapefile  via ogr2ogr

ogr2ogr -s_srs EPSG:25832 -t_srs EPSG:25832 -f "ESRI Shapefile" boden boden.vrt


the layer displays the data.
What is wrong with my VRT/CSV-datasource in the mapfile?

Thanks for any idea.

Best regards
Stefan
_______________________________________________
mapserver-users mailing list
mapserver-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20100120/1a7c10da/attachment-0001.html

------------------------------

Message: 5
Date: Wed, 20 Jan 2010 11:31:04 -0500
From: Christian Jauvin <cjauvin at gmail.com>
Subject: [mapserver-users] Announcement: Dracones,    a web mapping
    framework for MapServer
To: mapserver-users at lists.osgeo.org, ms4w-users at lists.maptools.org,
    community at lists.gispython.org
Message-ID:
    <aa5471511001200831h4e057996o6aa5ddbe2d81db61 at mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

Dear MapServer users,

I have created Dracones, a Python and JavaScript web mapping framework
based on MapServer, which I think could be of interest to the open
source web mapping/GIS community. It is available at:

http://surveillance.mcgill.ca/dracones

This framework began its life as a surveillance application for
Montreal Public Health. After a lot of refactoring sessions, I had the
idea of abstracting a set of core client/server services, that would
become the framework, and to rewrite the original application in terms
of those. Thus the set of features offered by Dracones stems from
pre-existing application needs, rather than the opposite.

In a nutshell, here is what Dracones provides..

On the client side:

* A lightweight but powerful map widget (100% JS), with state of the
art features like AJAX-based smooth scrolling and visual selection
* An extension mechanism to define new UI behaviors (e.g. what happens
when clicking on the map, or drawing a selection box around objects)

On the server side:

* A set of Python classes and functions (written on top of
Python-MapScript) that encapsulate the application state, and ease the
interaction with its map objects
* A well-thought extension mechanism, to define custom requests and queries

Dracones also provides a bunch of other application-centric features,
like easy map image export and undo/redo. Last but not least, I've
been very careful in writing the documentation and tutorials, which I
think cover a wide range of issues and possibilities.

This work is still in Alpha stage, and I will be of course very
interested to hear the community's comments and suggestions.

Best regards,

Christian Jauvin


------------------------------

Message: 6
Date: Wed, 20 Jan 2010 10:45:26 -0600
From: Kent Morrison <KMorrison at advantrack.com>
Subject: RE: [mapserver-users] RE: Images returning blank
To: 'Rahkonen Jukka' <Jukka.Rahkonen at mmmtike.fi>,
    "mapserver-users at lists.osgeo.org" <mapserver-users at lists.osgeo.org>
Message-ID:
    <4DCDDD4507E4E847920443D1B98C588D04A5210B33 at mail1.advantrack.local>
Content-Type: text/plain; charset="iso-8859-1"

Removing the PROJECTION from the trafficflow_2007 map results in the following error:

Cannot set new SRS on a map that doesn't have any projection set. Please make sure your mapfile has a PROJECTION defined at the top level.

So what I need to do is figure out how to setup the PROJECTION. Which I have no idea on.

The .prj file that can with the shp file is:

PROJCS["NAD_1983_StatePlane_Texas_South_Central_FIPS_4204_Feet",
    GEOGCS["GCS_North_American_1983",
        DATUM["D_North_American_1983",
        SPHEROID["GRS_1980",6378137.0,298.257222101]],
        PRIMEM["Greenwich",0.0],
        UNIT["Degree",0.0174532925199433]],

    PROJECTION["Lambert_Conformal_Conic"],
    PARAMETER["False_Easting",1968500.0],
    PARAMETER["False_Northing",13123333.33333333],
    PARAMETER["Central_Meridian",-99.0],
    PARAMETER["Standard_Parallel_1",28.38333333333333],
    PARAMETER["Standard_Parallel_2",30.28333333333334],
    PARAMETER["Latitude_Of_Origin",27.83333333333333],
    UNIT["Foot_US",0.3048006096012192]]


So now I am trying to figure out PROJECTIONS... Any suggestions or sites with examples that will help me here would be greatly appreciated.

Thanks
Kent 

-----Original Message-----
From: Rahkonen Jukka [mailto:Jukka.Rahkonen at mmmtike.fi] 
Sent: Tuesday, January 19, 2010 4:25 PM
To: Kent Morrison; mapserver-users at lists.osgeo.org
Subject: Re: [mapserver-users] RE: Images returning blank

Hi,

The non-working one is in some other projection than epsg:4326. You will get that layer visible by removing projection also from the MAP level and using the extents from ogrinfo, but in order to show both layers together you should know the correct projection for both datasets.
If projection is given at map level it must suit the extents.  Epsg:4326 and EXTENT 2460247.751004 232706.929725 2507483.898985 294550.472704 do not suit.

-Jukka-



-----Alkuperäinen viesti-----
Lähettäjä: mapserver-users-bounces at lists.osgeo.org puolesta: Kent Morrison
Lähetetty: ke 20.1.2010 0:14
Vastaanottaja: 'Fawcett, David (MPCA)'; 'mapserver-users at lists.osgeo.org'
Aihe: [mapserver-users] RE: Images returning blank

I ran ogrinfo.exe on the non-working file.

C:\ms4w\tools\gdal-ogr>ogrinfo.exe c:\mapserverdata\shapefiles\1\trafficflow_200
7.shp trafficflow_2007 -so
INFO: Open of `c:\mapserverdata\shapefiles\1\trafficflow_2007.shp'
      using driver `ESRI Shapefile' successful.

Layer name: trafficflow_2007
Geometry: Line String
Feature Count: 4212
Extent: (2460247.751004, 232706.929725) - (2507483.898985, 294550.472704) Layer SRS WKT:
(unknown)
CounterID: Integer (10.0)
Location: String (50.0)
StartDate: Date (10.0)
ADT_Total: Integer (10.0)
AWD_Total: Integer (10.0)
XCoord: Real (19.8)
YCoord: Real (19.8)
StreetID: String (16.0)
Shape_len: Real (19.11)


I added:

EXTENT 2460247.751004 232706.929725 2507483.898985 294550.472704

to the map file and changed the Layer Status to Default.

[Tue Jan 19 21:43:35 2010].791000 CGI Request 1 on process 2676 [Tue Jan 19 21:43:35 2010].791000 msTileSetExtent (-13073784.538762, 6051371.431753) (-13071348.108486, 6053807.862029) [Tue Jan 19 21:43:35 2010].791000 msDrawMap(): Layer 0 (SpokaneTrafficFlows), 0.000s [Tue Jan 19 21:43:35 2010].791000 msDrawMap(): Drawing Label Cache, 0.000s [Tue Jan 19 21:43:35 2010].791000 msDrawMap() total time: 0.000s [Tue Jan 19 21:43:35 2010].822000 msSaveImage() total time: 0.031s [Tue Jan 19 21:43:35 2010].822000 mapserv request processing time (loadmap not incl.): 0.031s [Tue Jan 19 21:43:35 2010].822000 msFreeMap(): freeing map at 01A5AF10.

Still a blank image.

When I ran ogrinfo.exe on the working shapefile:


C:\ms4w\tools\gdal-ogr>ogrinfo.exe c:\mapserverdata\shapefiles\1\co48_d00.shp -s o co48_d00
INFO: Open of `c:\mapserverdata\shapefiles\1\co48_d00.shp'
      using driver `ESRI Shapefile' successful.

Layer name: co48_d00
Geometry: Polygon
Feature Count: 265
Extent: (-106.645646, 25.837377) - (-93.516407, 36.500704) Layer SRS WKT:
(unknown)
AREA: Real (20.5)
PERIMETER: Real (20.5)
CO48_D00_: Real (11.0)
CO48_D00_I: Real (11.0)
STATE: String (2.0)
COUNTY: String (3.0)
NAME: String (90.0)
LSAD: String (2.0)
LSAD_TRANS: String (50.0)


The Extents on the working file are in lat/lon. In the non-working file it looks to be in something else.

I'm trying to return VE image tiles..

not sure where to go from here to get the first file to work.

Thanks

________________________________
From: Fawcett, David (MPCA) [mailto:David.Fawcett at state.mn.us]
Sent: Tuesday, January 19, 2010 3:28 PM
To: Kent Morrison; 'mapserver-users at lists.osgeo.org'
Subject: RE: Images returning blank



Based on the errors, it looks like you will need EXTENT to your map file at the MAP level.

What do you get when you run ogrinfo against the two shapefiles?  Any difference?

Are you adding a URL var for the layer name?  Try setting LAYER STATUS to DEFAULT for both layers and see if you get an image back.

David.

From: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Kent Morrison
Sent: Tuesday, January 19, 2010 3:17 PM
To: 'mapserver-users at lists.osgeo.org'
Subject: [mapserver-users] Images returning blank

I have mapserver 5.4.2 installed.

I have two different shape files, one renders properly the other only returns blank images

The debug log for the one that does not work returns:

[Tue Jan 19 20:34:59 2010].212000 CGI Request 1 on process 1180 [Tue Jan 19 20:34:59 2010].212000 mapserv(): Web application error. No way to generate map extent.
[Tue Jan 19 20:34:59 2010].212000 msCalculateScale(): General error message. Invalid image extent, minx=-1.000000, miny=-1.000000, maxx=-1.000000, maxy=-1.000000.
[Tue Jan 19 20:34:59 2010].212000 msTileSetExtent (-13090872.991896, 6046512.903143) (-13071381.549686, 6066004.345353) [Tue Jan 19 20:34:59 2010].227000 msDrawMap(): Layer 0 (SpokaneTrafficFlows), 0.000s [Tue Jan 19 20:34:59 2010].227000 msDrawMap(): Drawing Label Cache, 0.000s [Tue Jan 19 20:34:59 2010].227000 msDrawMap() total time: 0.015s [Tue Jan 19 20:34:59 2010].274000 msSaveImage() total time: 0.047s [Tue Jan 19 20:34:59 2010].274000 mapserv request processing time (loadmap not incl.): 0.062s [Tue Jan 19 20:34:59 2010].274000 msFreeMap(): freeing map at 01A5AF00.
[Tue Jan 19 20:34:59 2010].274000 freeLayer(): freeing layer at 020E4160.

the map file is:

MAP
    IMAGETYPE AGG
    SIZE 256 256
    SHAPEPATH "/MapServerData/ShapeFiles/1"
    IMAGECOLOR 255 255 255
    TRANSPARENT ON
    FONTSET "../../fonts/fonts.list"

CONFIG PROJ_LIB "c:\ms4w\proj\nad\"
CONFIG MS_ERRORFILE "c:\ms4w\tmp\errors2.txt"
DEBUG 5

    PROJECTION
        "init=epsg:4326"
    END

    OUTPUTFORMAT
        NAME 'AGG'
        DRIVER AGG/PNG
        IMAGEMODE RGB
    END #Outputformat

    LAYER
        NAME SpokaneTrafficFlows
        DATA TrafficFlow_2007
        STATUS ON
        TYPE LINE

        DEBUG 5

        CLASS
            NAME "classSpokaneTrafficFlows"

            STYLE
                COLOR 127 255 64
                OPACITY 50
                OUTLINECOLOR 255 128 64
                WIDTH 3
            END #style
        END #class
    END #layer
END #Map

running shp2img.exe returns:
msLoadMap(): Image handling error. Unable to initialize image
msCalculateScale(): General error message. invalid image extent ....

I get the same results for shp2img on the working shapefile/map file.


THE FOLLOWING WORKS:

MAP

  IMAGETYPE      AGG
  SIZE          256 256
  SHAPEPATH      "/MapServerData/ShapeFiles/1"
  IMAGECOLOR    255 255 255
  TRANSPARENT    ON
  FONTSET        "../../fonts/fonts.list"

CONFIG PROJ_LIB "c:\ms4w\proj\nad\"

  PROJECTION
    "init=epsg:4326"
  END

  OUTPUTFORMAT
    NAME 'AGG'
    DRIVER AGG/PNG
    IMAGEMODE RGB
  END #Outputformat

  LAYER
    NAME          TxCounties
    DATA  co48_d00
    STATUS      ON
    TYPE        Polygon

    CLASS
        NAME  "classTxCounties"

        STYLE
            COLOR        0 255 0
            OPACITY      25
            OUTLINECOLOR  0 0 0
            WIDTH      2
        END #style
    END #class
  END #layer
END #Map



Anyone have any idea's why this might not work in the first case? Or what else can I do to debug the problem?


Kent





------------------------------

_______________________________________________
mapserver-users mailing list
mapserver-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


End of mapserver-users Digest, Vol 24, Issue 61
***********************************************



      


------------------------------

_______________________________________________
mapserver-users mailing list
mapserver-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


End of mapserver-users Digest, Vol 24, Issue 63
***********************************************



      



More information about the MapServer-users mailing list