1

I have been trying to create a mapServer map by joining 3 table then create classes on those joins (2000 - red, 2010 - green, 2020 - blue)

I am not getting an error but noting is display

$query = "geom FROM (
   SELECT 
     a.geom, 
     b.geom, 
     c.geom 
   FROM 
     data2000 as a 
   INNER JOIN data2015 as b 
   ON b.province = '$variable' 
   INNER JOIN data2020 as c
   ON b.province = '$variable'
   ) AS subquery USING UNIQUE gid USING SRID=4326";

I would also like to see this represented in

CLASS
     data 1
     STYLE
        ....
     END
END
CLASS
     data 2
     STYLE
        ....
     END
END
CLASS
     data 3
     STYLE
        ....
     END
END
2
  • That SQL query does not make sense. Why aren't you using three layers?
    – CL.
    Commented May 18, 2020 at 14:20
  • Thanks man, I didn't think of that Commented May 19, 2020 at 8:55

1 Answer 1

3

First use join query as in example below

DATA "target_point from (select 
    events_objects_tbl.target_point, 
    events_objects_tbl.source_point, 
    geo_units_tbl.geo_unit_group 
from events_objects_tbl 
JOIN geo_units_tbl 
ON geo_units_tbl.id = events_objects_tbl.target_geo_unit_id 
   AND geo_units_tbl.date = events_objects_tbl.date
) as subquery using unique oid using srid=4326"

then use class with expression

CLASS
  NAME "events_targets_a"
  GROUP "events_targets"
  EXPRESSION ("[geo_unit_group]" = "Группа А")
  STYLE
    SYMBOL "a_targets_cluster"
    SIZE 64
  END
END

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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