1

I have 14 shapefiles from same source with the same WKT:

PROJCS["GRS_1980_Transverse_Mercator",
GEOGCS["GCS_GRS_1980",
DATUM["D_GRS_1980",
SPHEROID["GRS_1980",6378137,298.257222101]],
PRIMEM["Greenwich",0],
UNIT["Degree",0.017453292519943295]],
PROJECTION["Transverse_Mercator"],
PARAMETER["False_Easting",500000],
PARAMETER["False_Northing",-6000000],
PARAMETER["Central_Meridian",24],
PARAMETER["Scale_Factor",0.9996],
PARAMETER["Latitude_Of_Origin",0],
UNIT["Meter",1]]

This WKT does not match any CRS perfectly, but it is very similar to LKS92/Latvia TM:

PROJCS["LKS92_Latvia_TM",GEOGCS["GCS_LKS92",
DATUM["D_Latvia_1992",
SPHEROID["GRS_1980",6378137,298.257222101]],
PRIMEM["Greenwich",0],
UNIT["Degree",0.017453292519943295]],
PROJECTION["Transverse_Mercator"],
PARAMETER["latitude_of_origin",0],
PARAMETER["central_meridian",24],
PARAMETER["scale_factor",0.9996],
PARAMETER["false_easting",500000],
PARAMETER["false_northing",-6000000],
UNIT["Meter",1]]

Only 3 lines are different:

# WKT my shapefiles have
PROJCS["GRS_1980_Transverse_Mercator",
GEOGCS["GCS_GRS_1980",
DATUM["D_GRS_1980",

# WKT for LKS92/Latvia TM
PROJCS["LKS92_Latvia_TM",
GEOGCS["GCS_LKS92",
DATUM["D_Latvia_1992",

The only issue I am having right now - POINT type layer is not shown correctly on my map. RASTER, LINE, POLYGON type layers are displayed correctly. Layers of type POINT are not shown correctly.

Image #1 - shows how my map is displayed in mapserver. There is a single black circle outside of map extent area. What I expect to see is something similar to image#2. MapServer CGI
Image #2 - shows how the layers are displayed in QGIS. QGIS

Image #3 This is what I see when I open the shapefile with QGIS. objects layer CRS

I see 2 possible solutions:

  • I convert the POINT type shapefile (called places.shp) so that points are shown on the map
  • I create a new shapefile with a few POINT type elements which would be in same CRS and work properly in my application.

I have tried both options, used QGis and also ogr2gui. No matter what I do, POINT type layer is not shown properly and there is only a single black dot on the map:

mapfile.map:

LAYER
    NAME "places"
    DATA places
    STATUS ON
    TYPE POINT
    FEATURE
        POINTS
            1 1
        END
    END
    CLASS
        NAME "places"
        SYMBOL "circle"
        SIZE 16
        COLOR 0 0 0
    END
END

SYMBOL
    NAME "circle"
    TYPE ellipse
    FILLED true
    POINTS
        10 10
    END
END

I have tested my application on Mapserver 6.0.3 and 6.4.1.

Edit#1:

This is what QGIS tells me when I check properties of places.shp

Extents
In layer spatial reference system units
xMin,yMin 312500.00,172500.00 : xMax,yMax 762500.00,437500.00

extent I have defined in mapfile.map:

EXTENT 313187.4 146161.56 766469.92 470367.64
  • My guess is that the polygon data is using a projected coordinate reference system (CRS) while the point data is using a geographic CRS, aka latitude-longitude, but is defined or assumed to be in the same CRS as the polygon data. That fits with smaller lat-lon values showing up southwest of the other data. – mkennedy Apr 16 '14 at 22:10
  • @mkennedy I see. Any suggestions on how to convert my shapefile from geographic CRS to projected CRS? I just opened the shapefile with QGIS and edited my question, it seems the shapefile has unspecified projection... not sure. – afaf12 Apr 16 '14 at 22:28
  • I'm not familiar with QGIS, but similar questions have been asked before. Try searching with the terms, QGIS and projections. I wish I could help more. – mkennedy Apr 16 '14 at 23:57
  • Can you report the extent of the point file, as stated in the metadata tab of the layer properties when loaded directly into QGIS, and when received via mapserver? – AndreJ Apr 20 '14 at 16:28
  • Added the details. Not sure about the part "when received via mapserver". – afaf12 Apr 20 '14 at 16:48
2
+50

Where did you get the

FEATURE
    POINTS
        1 1
    END
END

from? This draws a point at x=1 y=1, and not at the coordinates from your shapefile:

enter image description here

  • You are right, this was complete inattention on my part. I misread the documentation about POINTS block. I only needed to use it inside the SYMBOL section and not the LAYER. Thanks! – afaf12 Apr 20 '14 at 16:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.