<div dir="ltr"><div>De rien lointain cousin du Québec ;-)<br></div>Rémi-C<br></div><div class="gmail_extra"><br><div class="gmail_quote">2015-03-12 19:43 GMT+01:00  <span dir="ltr"><<a href="mailto:Steve.Toutant@inspq.qc.ca" target="_blank">Steve.Toutant@inspq.qc.ca</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><font face="sans-serif">Wow merci Remi. That saves me a lot of
coding...</font>
<br>
<p>
<br>
<br>
<br>
</p><p></p><table style="border-collapse:collapse" width="100%">
<tbody><tr height="8" valign="top">
<td style="border-style:none none none none;border-color:#000000;border-width:0px 0px 0px 0px;padding:0px 0px" width="40%"><font size="1" face="sans-serif"><b>Rémi
Cura <<a href="mailto:remi.cura@gmail.com" target="_blank">remi.cura@gmail.com</a>>@<a href="http://lists.osgeo.org" target="_blank">lists.osgeo.org</a></b> </font>
<br><font size="1" face="sans-serif">Envoyé par : <a href="mailto:postgis-users-bounces@lists.osgeo.org" target="_blank">postgis-users-bounces@lists.osgeo.org</a></font>
<p><font size="1" face="sans-serif">2015-03-12 12:42</font>
</p><table style="border-collapse:collapse" width="169">
<tbody><tr height="8" valign="top">
<td style="border-style:solid solid solid solid;border-color:#000000;border-width:1px 1px 1px 1px;padding:0px 0px" bgcolor="white" width="167">
<div align="center"><font size="1" face="sans-serif">Veuillez répondre à<br>
PostGIS Users Discussion <<a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a>></font></div></td></tr></tbody></table>
<br>
</td><td style="border-style:none none none none;border-color:#000000;border-width:0px 0px 0px 0px;padding:0px 0px" width="59%">
<table style="border-collapse:collapse" width="100%">
<tbody><tr height="21" valign="top">
<td style="border-style:none none none none;border-color:#000000;border-width:0px 0px 0px 0px;padding:0px 0px" width="57">
<div align="right"><font size="1" face="sans-serif">A</font></div>
</td><td style="border-style:none none none none;border-color:#000000;border-width:0px 0px 0px 0px;padding:0px 0px"><font size="1" face="sans-serif">PostGIS
Users Discussion <<a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a>></font>
</td></tr><tr height="21" valign="top">
<td style="border-style:none none none none;border-color:#000000;border-width:0px 0px 0px 0px;padding:0px 0px" width="57">
<div align="right"><font size="1" face="sans-serif">cc</font></div>
</td><td style="border-style:none none none none;border-color:#000000;border-width:0px 0px 0px 0px;padding:0px 0px">
</td></tr><tr height="21" valign="top">
<td style="border-style:none none none none;border-color:#000000;border-width:0px 0px 0px 0px;padding:0px 0px" width="57">
<div align="right"><font size="1" face="sans-serif">Objet</font></div>
</td><td style="border-style:none none none none;border-color:#000000;border-width:0px 0px 0px 0px;padding:0px 0px"><font size="1" face="sans-serif">Re:
[postgis-users] median center instead of st_centroid</font></td></tr></tbody></table>
<br>
<table style="border-collapse:collapse" width="393">
<tbody><tr height="8" valign="top">
<td style="border-style:none none none none;border-color:#000000;border-width:0px 0px 0px 0px;padding:0px 0px" width="57">
</td><td style="border-style:none none none none;border-color:#000000;border-width:0px 0px 0px 0px;padding:0px 0px" width="336"></td></tr></tbody></table>
<br></td></tr></tbody></table><div><div class="h5">
<br>
<br>
<br>
<br>
<br><font size="3">Hey,</font>
<br><font size="3">what you want is extremely easy to get.</font>
<br><font size="3">First add the median function to your database from </font><a href="https://wiki.postgresql.org/wiki/Aggregate_Median" target="_blank"><font color="blue" size="3"><u>here</u></font></a>
<br><font size="3">(Now you have access to median(numeric) )<br>
</font>
<br><font size="3">Then,</font>
<br><font size="3">for a table my_table containing points in the geom column<br>
</font>
<br><font size="3">--not tested </font>
<br><font size="3">SELECT ST_MakePoint(median(ST_X(geom)), median(ST_Y(geom)))
as my_median_point</font>
<br><font size="3">FROM my_table<br>
</font>
<br><font size="3">Cheers,</font>
<br><font size="3">Rémi-C</font>
<br>
<br><font size="3">2015-03-12 14:56 GMT+01:00 <</font><a href="mailto:Steve.Toutant@inspq.qc.ca" target="_blank"><font color="blue" size="3"><u>Steve.Toutant@inspq.qc.ca</u></font></a><font size="3">>:</font>
<br><font size="3" face="sans-serif">Hi,</font><font size="3"> </font><font size="3" face="sans-serif"><br>
I used st_centroid on a multipoint table to get the mean center.</font><font size="3">
</font><font size="3" face="sans-serif"><br>
I would like to compare the result on the median center</font><font size="3">
</font><font color="blue" size="3"><u><br>
</u></font><a href="http://en.wikipedia.org/wiki/Center_of_population#Mean_center" target="_blank"><font color="blue" size="3" face="sans-serif"><u>http://en.wikipedia.org/wiki/Center_of_population#Mean_center</u></font></a><font size="3">
<br>
</font><font size="3" face="sans-serif"><br>
Is there already an operator in postgis that does that?</font><font size="3">
<br>
</font><font size="3" face="sans-serif"><br>
Otherwise I would like to write one, but I don't have much experience doing
that, so any tips on how to do that well would be appreciated</font><font size="3">
</font><font size="3" face="sans-serif"><br>
Thanks in advace for your help!</font><font size="3"> </font>
<p><font size="3"><br>
_______________________________________________<br>
postgis-users mailing list</font><font color="blue" size="3"><u><br>
</u></font><a href="mailto:postgis-users@lists.osgeo.org" target="_blank"><font color="blue" size="3"><u>postgis-users@lists.osgeo.org</u></font></a><font color="blue" size="3"><u><br>
</u></font><a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank"><font color="blue" size="3"><u>http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</u></font></a>
<br><tt><font>_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a><br>
</font></tt><a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank"><tt><font>http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</font></tt></a>
<br>
<br>
<br></p></div></div><p></p><br>_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br></blockquote></div><br></div>