2009/12/6 Philip Stubbs <[email protected]>:
> 2009/12/6 Michal Migurski <[email protected]>:
>> On Dec 5, 2009, at 5:11 PM, Philip Stubbs wrote:
>>
>>> Ok. Before I get too deep into sql I have thought of an alternative
>>> solution. If I use point placment, many more labels appear.
>>> Unfortunatly, it looks a mess. So, is it possible to ammend the layer
>>> definition for the text layer to only pick up roads within a certain
>>> length range?
>>>
>>> Looking at the postgis docs looks like there is an ST_Length function.
>>> Can I use this in my layer definition?
>>
>>
>> Yes, you can put an awful lot of complicated SQL into the "table"
>> parameter. Here's one we used not long ago: http://dpaste.com/129815/
>
> Thanks for that. It may take me some time with an SQL reference and
> PostGIS docs to pick that apart, but it looks like I may be in the
> right direction. If I get something that works, I may post back.
I am inching forward here. My road text layer now uses the following
SELECT statement
<Parameter name="table">
(SELECT way,highway,aeroway,name,ref,char_length(ref) AS length,
ST_Length(way) AS road_len,
CASE WHEN bridge IN ('yes','true','1') THEN 'yes'::text ELSE
bridge END AS bridge
FROM planet_osm_line
WHERE waterway IS NULL
AND leisure IS NULL
AND landuse IS NULL
AND (name IS NOT NULL OR ref IS NOT NULL)
ORDER BY road_len DESC
) AS roads
</Parameter>
Now the road_len allows me to create a rule that selects point
placement when the road gets too short. Great! Now I still have a
problem where I have a residential road that has side branches with
the same name. It seems to me that there should be a way to adjust
that select statement to give me only one of each name. Any ideas?
Thanks again.
--
Philip Stubbs
_______________________________________________
Mapnik-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mapnik-users