<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.Shkpostityyli17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 2.0cm 70.85pt 2.0cm;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="FI" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">If you want to do is fast, try sortshp and sort your shapefile by your attribute
<a href="http://mapserver.org/utilities/sortshp.html">http://mapserver.org/utilities/sortshp.html</a>.  It should work well if one attribute is enough for sorting and in some cases it may be possible to get a usable result by sorting the sorted shapefile again
 by another attribute.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">More flexible would be to import the shapefile into database, for example Spatialite, create index the attributes needed for sorting and use ORDER
 BY in the LAYER DATA.  It may also be possible to connect your shapefile directly through OGR and use SQL in the same way in the DATA line somehow like<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">CONNECTIONTYPE OGR<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">CONNECTION "full/path/to/test.shp"<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">DATA "SELECT * from test ORDER BY attribute"<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">This is probably the slowest alternative. I have not a tested example available and I do not know if this works really.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">-Jukka Rahkonen-<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">Jesper Kempe wrote:<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><span lang="EN-US">Hi <o:p></o:p></span></p>
<div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">I have a shapefile with quite many points in. Several of the points are very close or even on the same locations. Every
</span>point has some attributes and some of the points are more important than others (based on a attributes value).<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">What I am trying to do, and not succeding in, is to have points with attribute x=Y drawn ontop of everything else.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Now I have a layer definition with the classes I want to have "in the bottom of the image" first and the most important last. Each with an expression matching a certain attribute. But it looks like the only order that matters is the order
 in which the points in the shapefile are listed.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">From the mapfile:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">                TILEITEM "location"<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">                TILEINDEX "shapefile.idx.shp"<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<div>
<p class="MsoNormal">                SIZEUNITS meters<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">                CLASSITEM "GEOM_TYPE"<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">                CLASS<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">                    NAME "clouds"<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">                    EXPRESSION "clou"<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">                    COLOR 186 186 186<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">                    SYMBOL "mapinfo-sym-32"<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">                    SIZE 1200<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">                END<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">                CLASS<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">                    NAME "no_d"<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">                    EXPRESSION "no_d"<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">                    COLOR 0 0 0<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">                    SYMBOL "mapinfo-sym-32"<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">                    SIZE 1200<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">                END<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">                CLASS<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">                    NAME "subs"<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">                    EXPRESSION "subs"<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">                    COLOR 255 255 0<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">                    SYMBOL "mapinfo-sym-32"<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">                    SIZE 1200<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">                END<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">                CLASS<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">                    NAME "surfs"<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">                    EXPRESSION "surf"<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">                    COLOR 246 112 38<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">                    SYMBOL "mapinfo-sym-32"<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">                    SIZE 1200<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">                END<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Anyone has a tip on how I can get the desired effect?<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">//Jesper<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
</div>
</body>
</html>