From 77c8b01daf605bbe9187a29923054d9e82bb27fa Mon Sep 17 00:00:00 2001 From: Simon Brooke Date: Tue, 28 Jan 2020 20:06:24 +0000 Subject: [PATCH] Not working in this form --- project.clj | 8 +- .../img/map-pins/Anchor-customer-pin.png | Bin 0 -> 1648 bytes .../img/map-pins/Anchor-customer-pin.svg | 166 ++++++++++++++ .../img/map-pins/Broadband-supplier-pin.png | Bin 0 -> 1924 bytes .../img/map-pins/Broadband-supplier-pin.svg | 213 ++++++++++++++++++ .../public/img/map-pins/Investor-pin.png | Bin 0 -> 1917 bytes .../public/img/map-pins/Investor-pin.svg | 162 +++++++++++++ .../public/img/map-pins/Landowner-pin.png | Bin 0 -> 1841 bytes .../public/img/map-pins/Landowner-pin.svg | 169 ++++++++++++++ .../public/img/map-pins/Operator-pin.png | Bin 0 -> 1996 bytes .../public/img/map-pins/Operator-pin.svg | 161 +++++++++++++ .../img/map-pins/Other-key-customers-pin.png | Bin 0 -> 1777 bytes .../img/map-pins/Other-key-customers-pin.svg | 162 +++++++++++++ .../img/map-pins/Power-supplier-pin.png | Bin 0 -> 2198 bytes .../img/map-pins/Power-supplier-pin.svg | 174 ++++++++++++++ src/clj/geocsv/handler.clj | 24 +- src/clj/geocsv/routes/home.clj | 11 +- src/clj/geocsv/routes/json.clj | 91 ++++++++ 18 files changed, 1323 insertions(+), 18 deletions(-) create mode 100644 resources/public/img/map-pins/Anchor-customer-pin.png create mode 100644 resources/public/img/map-pins/Anchor-customer-pin.svg create mode 100644 resources/public/img/map-pins/Broadband-supplier-pin.png create mode 100644 resources/public/img/map-pins/Broadband-supplier-pin.svg create mode 100644 resources/public/img/map-pins/Investor-pin.png create mode 100644 resources/public/img/map-pins/Investor-pin.svg create mode 100644 resources/public/img/map-pins/Landowner-pin.png create mode 100644 resources/public/img/map-pins/Landowner-pin.svg create mode 100644 resources/public/img/map-pins/Operator-pin.png create mode 100644 resources/public/img/map-pins/Operator-pin.svg create mode 100644 resources/public/img/map-pins/Other-key-customers-pin.png create mode 100644 resources/public/img/map-pins/Other-key-customers-pin.svg create mode 100644 resources/public/img/map-pins/Power-supplier-pin.png create mode 100644 resources/public/img/map-pins/Power-supplier-pin.svg create mode 100644 src/clj/geocsv/routes/json.clj diff --git a/project.clj b/project.clj index 9992b17..3da9450 100644 --- a/project.clj +++ b/project.clj @@ -1,19 +1,23 @@ (defproject geocsv "0.1.0-SNAPSHOT" - :description "FIXME: write description" + :description "A wee tool to show comma-separated value data on a map." :url "http://example.com/FIXME" - :dependencies [[ch.qos.logback/logback-classic "1.2.3"] + :dependencies [[adl-support "0.1.6"] + [ch.qos.logback/logback-classic "1.2.3"] [cheshire "5.9.0"] [cljs-ajax "0.8.0"] [cljsjs/leaflet "1.2.0-0"] [clojure.java-time "0.3.2"] [com.cemerick/url "0.1.1"] [com.cognitect/transit-clj "0.8.319"] + [compojure "1.6.1"] [cprop "0.1.15"] + [csv2edn "0.1.5"] [day8.re-frame/http-fx "0.1.6"] [expound "0.8.3"] [funcool/struct "1.4.0"] + [lib-noir "0.9.9" :exclusions [org.clojure/tools.reader]] [luminus-jetty "0.1.7"] [luminus-transit "0.1.2"] [luminus/ring-ttl-session "0.3.3"] diff --git a/resources/public/img/map-pins/Anchor-customer-pin.png b/resources/public/img/map-pins/Anchor-customer-pin.png new file mode 100644 index 0000000000000000000000000000000000000000..4cbe582431c38ff8f8c0da9f3aceac8efc9da01d GIT binary patch literal 1648 zcmV-$29NoPP)JM$2_#Zwc4>2IZ*DpuF)lJ7Bnk-}(96dF000(r zMObu0a%Ew3X>V>IRB3Hx05UK!FfceUF$+otl>h(*K1oDDR9JwS>_5>;P?A&9*^gfR7!oQ zX`&uf5ibNHDJ26!$dd~T3t#p0^eh1gfMdsw`I1Tb6Nqi&a9(y4lDRaT z&Lw+m>%d-{%@{L`<^B5Z-Mc?kN_+qE<(IDICQWK^x&=xS&>V(k9WFLNbrc*%HqAuB zVoXnOn5nCqeOcGFN1Bx4#Q3;pe0?juxE0z)Kv!_74klgD(FecO=hlT-%pRYZ@JuKr zPH37&LnLC4u168##o$W7m>W9#!5xP|57-RT8@Vwz=a|ri*6c zP_+p6%OK)NmpydB!7)%-w=oOx8v}5)7Piko!!xc9Hk$8<1CHKFmkqh$N-Z27D3I8b zfOoPgXU4Xu`D90)r~1Vq3-Lc2{+sFS`fCu+*x}3`7%#~z&xOen=-OjOL|(*q%Aw;X z^wzC62d}~qaHS49|AhXEJc(yZpym;@4MV6AQeyqYp+;yO0dMU2P|Hc2(#)FcU4-U` zX7OJSPPM>}X)}fD3XCQZ; zxau{_VB08cdi?zSupO>!g~~_JJ_g_K1figHG*4phBDmsE8H4i;W+GV#!*4!_*;eOC zVdiA#vRN`+3HY%d8p05EW~*8jKtiTY_N_tl-CG1bTfjdGZw{r;>FiG*U#bO10`^V; zQ<*6hfYhX9x};=z&C>^MV`f(wY&5&dOh{<(!w#?-W`nRcoX%y3luT~Y2rIgR!7OkLtmPlCY zFI;HqH4ObpQt|um?sK`~QIMYlX-PxVw4_q%UN9K!OY=l#2W3WQXJ=(9rS1<8mrvfh zT?v0KyB`F!oX$xrb7!pKEI7s&rimr*ml|(EGm=0|=o`mX7AtjqeJvQE+=} uwOYScN-Zd*P8VvUU>rGe + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Basic pin for SceneHere + 20100801 + + + Simon Brooke + + + + + Copyright (c) 2010 Simon Brooke + + + basic_map_pin.svg + + Basic default map pin + $Revision: 1.2 $ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/public/img/map-pins/Broadband-supplier-pin.png b/resources/public/img/map-pins/Broadband-supplier-pin.png new file mode 100644 index 0000000000000000000000000000000000000000..7d07d8bf8b20a411fccb13c7426a9565337991a8 GIT binary patch literal 1924 zcmV-~2YdL5P)JM$2_#Zwc4>2IZ*DpuF)lJ7Bnk-}(96dF000(r zMObu0a%Ew3X>V>IRB3Hx05UK!FfceUF$+otl>h(+Qb|NXR9J<*mTznu2DoN2Hl(WRpC%?I^qcDd$B!S6Fw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ources/public/img/map-pins/Broadband-supplier-pin.svg b/resources/public/img/map-pins/Broadband-supplier-pin.svg new file mode 100644 index 0000000..905c241 --- /dev/null +++ b/resources/public/img/map-pins/Broadband-supplier-pin.svg @@ -0,0 +1,213 @@ + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Basic pin for SceneHere + 20100801 + + + Simon Brooke + + + + + Copyright (c) 2010 Simon Brooke + + + basic_map_pin.svg + + Basic default map pin + $Revision: 1.2 $ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/public/img/map-pins/Investor-pin.png b/resources/public/img/map-pins/Investor-pin.png new file mode 100644 index 0000000000000000000000000000000000000000..cebbfbba7a5c56a6a77a82adc2322eff9d1b9b64 GIT binary patch literal 1917 zcmV-@2ZH#CP)JM$2_#Zwc4>2IZ*DpuF)lJ7Bnk-}(96dF000(r zMObu0a%Ew3X>V>IRB3Hx05UK!FfceUF$+otl>h(+OG!jQR9Jycs1rtfmHJeK z1w!wJu>=@-6I$Wea6zdIs4FeW3!9speaPiwp8?a4}&4=(7u#L_ny}|dsyOn6DjclRuF{M2+_(d6}?B*Op_A9FYNE1 z-rP0fG-`0Vp~iUa!3ny^L2tb1kS8`_L?k!c!n26HS!cbLso~_s#O6xhnb$5&s^d8B zRhC7tyiOSLjaBJ8zYLb|yAUk{07xZdX8Y;z)a|Fkid@f-Xi(EB<;6suFw%D{Y+Q~B zz?6IR$%q;m0H8OL){T|F6?2_B2u;O=0>@!W#v(V=7zc7OwHw&Pi!;ss zu{a#2giz4nTm+x3F%3RmZs@-g@3py>ZjHiVDIq6g0Dx~BO3#&>xe>K|l~ogYeV(;9 zSG}B#EqW|%denAFEx&q>LV)#GQLPqqZk1 z4dITL%iH(VJ5QK+EGlu2_bF?PY3v;m3zXt%Lh*C^d~@dSx>|eqN?cev!xY@~sO^Fh zw=0xZ)ELt^I4WzD;EWhJKTp<)R?I5Q+FY)C5zGJ$_(d+O zM+gAEs(1dO=dh$Cd_I^gZ1KdLN;!;xZd+J#)}qgTb|9_Mvp@q_rqJ|j#8e_tlr>JZ z4sE<;S=nzB1umv!paip)N$q&bacbGUreJ1Hq6i%sGCCwc2bk*W>W(DAYkN}~{X^zh zFw=dqnM=L$pt;AQW8<+j#o?sPiSq5!YS7^H{dVo}irIyizix1L%ysIrRwN1lA6<1! z_aw9?Lg@1d0Kn~bKgBY5?-X4!w9G!}oncHwSVUF7Y@tz!^^N@do;!?;Sfpna+i|1H z^D(`!d%!y7azbk%6dD>E8=Gzx=ytp3at!)Hrs#ep0gOPZ(4~Uw%K9%jc`?q;5Mf#%W4vS7T#i=dE$o9ZCsHmMkd-O1c+W!~H9q0S^Gc zxtLCP*E{iHLdd+Prl#L>)yjFx1OV8-e}6zGbnD?E)5H`-7y#f{*l1@Ey_}C}-o^j` zk|b?UQp~r7OvL~IoiUvtQ}jc=I(Zwnw6qK$N)8_hn;a5Fs9)p@0igYVHwFNZDcX54 zuC*VFm~0XS4k2_rUyZzm>jqpdm)2qydJ7m?AD3`&U*q?a^3@nu#cgeENr}*pBNC&N z0PPu%#<+|D0C=AN3@D9KO81RdW87H0c=1XYXS@CZ4yd0#-3znm00000NkvXXu0mjf Dr6YB2 literal 0 HcmV?d00001 diff --git a/resources/public/img/map-pins/Investor-pin.svg b/resources/public/img/map-pins/Investor-pin.svg new file mode 100644 index 0000000..da764a0 --- /dev/null +++ b/resources/public/img/map-pins/Investor-pin.svg @@ -0,0 +1,162 @@ + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Basic pin for SceneHere + 20100801 + + + Simon Brooke + + + + + Copyright (c) 2010 Simon Brooke + + + basic_map_pin.svg + + Basic default map pin + $Revision: 1.2 $ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/public/img/map-pins/Landowner-pin.png b/resources/public/img/map-pins/Landowner-pin.png new file mode 100644 index 0000000000000000000000000000000000000000..0a8a6ec371c7cd372eb30896a98e9747a10af822 GIT binary patch literal 1841 zcmV-12hRA3P)JM$2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uMDZfGGl0Et~V+d|L!yEgtqOshzIZ zr*820`1l=#Jd?Q5zEvq*7;D}jF!_H611KrpTuX#nQa7VbQVP2e;#|ERo9dc}hK3pf zLEoayQF5CFTViBnY+Jn^n_BV2#DpO&ep)gdE~T`$Hsi4=Fo4tP{3WQ2QtB_8_1JU_ f4-db_CXegC!}e~)PIki900000NkvXXu0mjfuYzzm literal 0 HcmV?d00001 diff --git a/resources/public/img/map-pins/Landowner-pin.svg b/resources/public/img/map-pins/Landowner-pin.svg new file mode 100644 index 0000000..3f3a1a7 --- /dev/null +++ b/resources/public/img/map-pins/Landowner-pin.svg @@ -0,0 +1,169 @@ + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Basic pin for SceneHere + 20100801 + + + Simon Brooke + + + + + Copyright (c) 2010 Simon Brooke + + + basic_map_pin.svg + + Basic default map pin + $Revision: 1.2 $ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/public/img/map-pins/Operator-pin.png b/resources/public/img/map-pins/Operator-pin.png new file mode 100644 index 0000000000000000000000000000000000000000..114a5f71509de50f0489f0c2405198e9738e9df3 GIT binary patch literal 1996 zcmV;-2Q&DIP)JM$2_#Zwc4>2IZ*DpuF)lJ7Bnk-}(96dF000(r zMObu0a%Ew3X>V>IRB3Hx05UK!FfceUF$+otl>h(+nn^@KR9JC(|)i`#|^H;q}im=x-o5x-HK^Q)7aQ-cWV>0iDbj_rH$H6 zT9HdI+HRJ1pkiccb&6%waua1xkc%_OaG7)24av74H(TRXm7je+ef#dAXyb#=eOOWuugpmGwtS(svy@ z_FYRLsMm}5#v82PyO$ihooKHYv9FI+RaGRMI6>0w+ek0I$f&`gHgys;4rz}BriY-=O*$PqTQwP9&$qSa_b zo69FY{?SB!et&;+vvseiX<|xh>Zm)=G?kQ)(%Xxvx|-H6zrOtY}taRwwCXI{E)Uun#IDj(}^i52~TDw z-q~?kS$LC@@Hm}>S}aU|^bzS*Rjgh%cytsQK$6fU30)B8k5yGfQS`??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$SBI;rcyXydO9o%KaN)in zXbp{x32}-d3HR=qB7n>PcQAme3ZLG*85z^uY>iSB!5|1i%Thg-lw30^EG#reMw_EDH<}931>t&^@}YpIffSvbAH! ejz6%><@z^Z*`87t)AF + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Basic pin for SceneHere + 20100801 + + + Simon Brooke + + + + + Copyright (c) 2010 Simon Brooke + + + basic_map_pin.svg + + Basic default map pin + $Revision: 1.2 $ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/public/img/map-pins/Other-key-customers-pin.png b/resources/public/img/map-pins/Other-key-customers-pin.png new file mode 100644 index 0000000000000000000000000000000000000000..3cfa7e8e24fa1093afc0cf4d600ce36a13df2fc4 GIT binary patch literal 1777 zcmVJM$2_#Zwc4>2IZ*DpuF)lJ7Bnk-}(96dF000(r zMObu0a%Ew3X>V>IRB3Hx05UK!FfceUF$+otl>h(*zez+vR9J<*m+wzo*BQq@=UyBC zz(0Xf^CK+5q>CE}8>yPKU0c#r)hg9lle}3gHPK!~d$FpM@;B`5_GZ$wNs}UyYJD+H z0fB-iA`#<$95`{}M61lp5rJs;MSW36 z(vcJep>_hSbR{yrj5pDoXa&A8mHG3bp`obg?d`SuJiafihPA2VYR8whb(^tyV4AdL zk;U2^Io*pl+eFhwH4`vghGX)%$sW^g{wHf@pRsto-gku*!H%mPW1FE9O!y*1o?2j` zK_W#l?!=ktqHFF5N2cxA3+00C>-J3WTJX!eNAA90wOW6phn@=k)gSez>u2j1i%G)_ zcMLQ9(>2y=6-sP2$dk85i8g%A*MU9kS$5&dmkYP%tft{M?1tOu)X?Z~Bpk`&%gbEe zGtT&r1wu8`yi!M9s+7qptF8-NIFuq)Q!W_58F#JU0ldkZ zpLf%}3^2gJz8l;KZZ}zH-8sb2zPEY%U*&>zsY`{b(KZJoM1l$>ym;4(P=J?tdHPXC z6HK(mh}p{p7qtaE%WNZnfl-qss~6)dtT-NJpitr#w;HPkr%7833>!d}Y|RIJ@RM0) zJ-4}CKg7_1$C<>4)m93&6d!Wrwyb`JnZP;D1Pc z0B`Zuje6>nrINSHhAkH+d@Dp~?qfdQA0hIis=+Q?`7@lk)_zALyaUExZn1xw+1o{w%H`#*=PQuWYt?=@cgwvompK$4`ZkG?~%^ZK12 z!TAsQu=^UwVsT_6^>+vzy(EBaC#9Gv55YfP3hj56A}Io|?E#g5!$0nj$BB~IKEC+-2rk+T{Y`U94`hp( zY^i)3`bJHnCDDXNza9#OZc2;%t>HGD{&|1dKZtUaC5sJPuATOK2RJZS+f&<^u1kBQ zlD`xH;c)mDx~Bi#k#NKUcLGzM6;D#A9cp2O5^GPac^5(p9T{JyPN7Z?3=9lD+}?0F zd{{^Sv(i*|DFdN|=}bD8+rDVKV_&y#xpCy3`I_lxraRNV^b<;`l0``<@f8}s?(gsa zCp>7{HY*$s@7HyGuat6ow`kMQ&RTMoVCZt_s&48J+n2k&cMoPfnWRMi4#;jEq-k1S zDfP|3z`*S-6DhqxrFH!H@kUip6AjZ13#~U>Cjn9oDeu$^Q$LeZJ~ucxc)eV&iVDcZ zix-z9@(;1L*ep25g=Wk_9{&cSL#zS_|m0I zi%P1|_^x=9(v>h=h99{4y@LUiQ0F%4Hl9p0CmNJcRw2ar4+2i5QvCw4I^Q|pg=DV3 zzklin0Y@ScLn42lugN>m_**p|RsR-kHrt<+QYod>KdSYpTE~tZJ41!Fps4=>{sB~Q Tp;tnx00000NkvXXu0mjfFD5`I literal 0 HcmV?d00001 diff --git a/resources/public/img/map-pins/Other-key-customers-pin.svg b/resources/public/img/map-pins/Other-key-customers-pin.svg new file mode 100644 index 0000000..df0a5e3 --- /dev/null +++ b/resources/public/img/map-pins/Other-key-customers-pin.svg @@ -0,0 +1,162 @@ + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Basic pin for SceneHere + 20100801 + + + Simon Brooke + + + + + Copyright (c) 2010 Simon Brooke + + + basic_map_pin.svg + + Basic default map pin + $Revision: 1.2 $ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/public/img/map-pins/Power-supplier-pin.png b/resources/public/img/map-pins/Power-supplier-pin.png new file mode 100644 index 0000000000000000000000000000000000000000..c766d43e0ce5bac0e51e18aa3b406ab7db900a1f GIT binary patch literal 2198 zcmV;H2x<3;P)JM$2_#Zwc4>2IZ*DpuF)lJ7Bnk-}(96dF000(r zMObu0a%Ew3X>V>IRB3Hx05UK!FfceUF$+otl>h(-WJyFpR9J<*mu+lQ*B!>6bFN<# zCw3CsiLpZ@Bh26K5!fF+Ou36K}!7$@;d9NS53U;Ey3_93J=;3OnveLntQp5Of+-*bHq z!9zJ54voQJc%5^)8(<{>SK^t7BnhFtj7c9wB9Y%Yoz6G_5CEvJueZrEKMg{Q1);(t zC~RSH%AXCF5hg#-OUX_f!0yR%@|EMqk9&y2;n3*yIqigGTQr&bI|wnw(>pM@2T$ci z!u^@)vf29L$-<>Cj{-DpH)mdLJop$9l|LXmcGP!Kp;E2Z z?(9x2oSb-|?z;Vck;`?gD47^nWn@?;WLZ?G)Y;=%!)5NlmO{pog2Aw2 zY{i=0pB0zXds|M_ZD1@(^*N={R5MCdEF;r0`N}t&+dL1>=62scQqtS=H+x^-KT0f? z=ZDM6_w}31Ya;+ag{2`PT`yN~&Xphv1^}Jcf4#ix_K`A5m2Alphi7H^_wE}_YsTkV z-p6INZ4Fv&TY~|Adsg@DKQ12{a$1KxPHS2DzOIVZhwg(Y80So-NNp0uF%=<{Z+rQl z=e3yy2>^)41D|gz&Sk>6Oj2Wy;&et_msJ#ByW#Eb*yKpxsh0W|L~%@&+A{+@Wx`0y z$sLZlrfU3T!?uOQ(`g3SVs!+RDxH+BP)f#y-kt_~ZtkjpxnNx&HRl_-Y77Q%8K1N7 z>`^E+a=Lz_sX8<(xUg{BXkp>D(R7XdeV^p__B3Ec+3x;j%U<=T<_7wkBdwQzWHg#8 zL(7ZneY4N`Na=Tb8VwJ9YNAvr+iWieAJ5sAzBEb&l|1D6kNIi+o*L})UNbW;(ffUk zPnf%0$4#6`)a$+aY{3D4M^-!@&2{yWo6fo2r}F-L<;^NeRk9c#)du_> zSeTD)F#s^-ulI*ScXLHCIPXC7 zf(HjrnmCt<)wb0K0Et9MakKMqDWyu8Ql)&e^KfY*5mEqv)wb2gxl9HJPtLpC^MZ#x z=S_k_D_N~uf=r52=ea#qa}m)SiAo1>*M3D>~sI#RV_(zYPD_&Dij&XVb6sx z3TE*8J4{C7YCnYlr*m)RXy7wbMdiVpCHC)(6qmf_t*rV<=UA{S@6&VNT@6s=}djtSH@e*XO%h(0b{I z<(4Hi{zM|I_KjT8&*eSmOW<*zF#`m_;4S^2>txZ=qHnmWs^92+ysoPHjb2e4Qw`j2 zUQP%d00`XfGbVGv#_*!RUhfqX2>76@rKq5wW~ip-@a@@ZH*Wk@cRUtQy9Q1y0|EDX z+spu-c*tqZy411gh$<59HGp%HlUp{r*>R*3RG9tbNd^AG*FU&nG=9|&&Ph1jV~9-- zt7a=#0AOHKegplDX1DuHJ^;kyehuf000e4Hj@WwXVEL@jR6|u(5+DHQRy^ z17u<0OWtM0b-srzrT_#VFfrlQ1_C#X(wmhu^h5Sc{Bf4+(H@ZTw=NDvRnH@tFsa8N#{RmB z^WJ=bf9vScqu0oEy0*4<10jm{2w@fJ4X7jtHor>q?QTNzV>5FhRXqBaRZMo9rrw*h z{Wl2V`!Oj?a{I;kjL~)Rij1sNxr3%#5K&soFHGRM+(afGqXs#n^k#GsZR^J9ez? zX}uQoLpC-x`Z$;0O(w4ua-N`5;Ldzbg#Lv<7YqgfNs^9$C)9GX-3$OszON@-KDkhz z1%pqVI57g?tR%Ht2$2cr{u}_8|L+sP(p0} z3Lp$NH8u5pDPX758RuO74QCTtKyFx!$D%(^YPI?goFl?H|JPzY7Om~uw|^fC{1!~> Ye>5Ig&K)Y6NdN!<07*qoM6N<$f{ij5vH$=8 literal 0 HcmV?d00001 diff --git a/resources/public/img/map-pins/Power-supplier-pin.svg b/resources/public/img/map-pins/Power-supplier-pin.svg new file mode 100644 index 0000000..74f9329 --- /dev/null +++ b/resources/public/img/map-pins/Power-supplier-pin.svg @@ -0,0 +1,174 @@ + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Basic pin for SceneHere + 20100801 + + + Simon Brooke + + + + + Copyright (c) 2010 Simon Brooke + + + basic_map_pin.svg + + Basic default map pin + $Revision: 1.2 $ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/clj/geocsv/handler.clj b/src/clj/geocsv/handler.clj index 15308eb..48c42d8 100644 --- a/src/clj/geocsv/handler.clj +++ b/src/clj/geocsv/handler.clj @@ -1,13 +1,14 @@ (ns geocsv.handler - (:require - [geocsv.middleware :as middleware] - [geocsv.layout :refer [error-page]] - [geocsv.routes.home :refer [home-routes]] - [reitit.ring :as ring] - [ring.middleware.content-type :refer [wrap-content-type]] - [ring.middleware.webjars :refer [wrap-webjars]] - [geocsv.env :refer [defaults]] - [mount.core :as mount])) + (:require [compojure.core :refer [routes wrap-routes]] + [geocsv.env :refer [defaults]] + [geocsv.middleware :as middleware] + [geocsv.layout :refer [error-page]] + [geocsv.routes.home :refer [home-routes]] + [geocsv.routes.json :refer [json-routes]] + [reitit.ring :as ring] + [ring.middleware.content-type :refer [wrap-content-type]] + [ring.middleware.webjars :refer [wrap-webjars]] + [mount.core :as mount])) (mount/defstate init-app :start ((or (:init defaults) (fn []))) @@ -17,7 +18,10 @@ :start (ring/ring-handler (ring/router - [(home-routes)]) + [(home-routes) + (-> #'json/json-routes + (wrap-routes middleware/wrap-csrf) + (wrap-routes middleware/wrap-formats))]) (ring/routes (ring/create-resource-handler {:path "/"}) diff --git a/src/clj/geocsv/routes/home.clj b/src/clj/geocsv/routes/home.clj index 9eec70f..fbfd090 100644 --- a/src/clj/geocsv/routes/home.clj +++ b/src/clj/geocsv/routes/home.clj @@ -1,10 +1,9 @@ (ns geocsv.routes.home - (:require - [geocsv.layout :as layout] - [clojure.java.io :as io] - [geocsv.middleware :as middleware] - [ring.util.response] - [ring.util.http-response :as response])) + (:require [clojure.java.io :as io] + [geocsv.layout :as layout] + [geocsv.middleware :as middleware] + [ring.util.response] + [ring.util.http-response :as response])) (defn home-page [request] (layout/render request "home.html")) diff --git a/src/clj/geocsv/routes/json.clj b/src/clj/geocsv/routes/json.clj new file mode 100644 index 0000000..b9e7d30 --- /dev/null +++ b/src/clj/geocsv/routes/json.clj @@ -0,0 +1,91 @@ +(ns geocsv.routes.json + "JSON routes for geocsv." + (:require [adl-support.core :as ac] + [adl-support.rest-support :as ar] + [clojure.core.memoize :as memo] + [clojure.java.io :as io] + [clojure.string :as s] + [clojure.tools.logging :as log] + [compojure.core :refer [defroutes GET POST]] + [csv2edn.csv2edn :refer :all] + [noir.response :as nresponse] + [noir.util.route :as route] + [ring.util.http-response :as response] + )) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;; +;;;; geocsv.routes.json: data service handlers. +;;;; +;;;; This program is free software; you can redistribute it and/or +;;;; modify it under the terms of the GNU General Public License +;;;; as published by the Free Software Foundation; either version 2 +;;;; of the License, or (at your option) any later version. +;;;; +;;;; This program is distributed in the hope that it will be useful, +;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;;; GNU General Public License for more details. +;;;; +;;;; You should have received a copy of the GNU General Public License +;;;; along with this program; if not, write to the Free Software +;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +;;;; USA. +;;;; +;;;; Copyright (C) 2016 Simon Brooke for Radical Independence Campaign +;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(defn get-pin-image-names + [request] + (ar/do-or-server-fail + (map + #(s/replace (.getName %) #"-pin\.png$" "") + (let [grammar-matcher (.getPathMatcher + (java.nio.file.FileSystems/getDefault) + "glob:*-pin.png")] + (->> "resources/public/img/map-pins" + clojure.java.io/file + file-seq + (filter #(.isFile %)) + (filter #(.matches grammar-matcher (.getFileName (.toPath %))))))) + 200)) + +(defn get-data-uri + "Return JSON formatted data taken from the CSV file at this URI. The file + must exist, be publicly readable, and use commas as separators." + [uri] + (csv->json uri)) + +(defn get-data-google + "Return JSON formatted data taken from the Google Sheets spreadsheet with + this `docid`. The spreadsheet must exist and must be publicly readable." + [docid] + (get-data-uri + (str + "https://docs.google.com/spreadsheets/d/" + docid + "/export?format=csv"))) + +(defn get-data-file + "Return JSON formatted data taken from the CSV file with the name `filename` + in the directory `resources/public/data`. TODO: There is a safe way to + access the content of the resource directory but I don't recall it just now." + [filename] + (csv->json (io/reader (io/file (str "resources/public/data/" filename))))) + +(defn get-data + [request] + (ar/do-or-server-fail + (let [params (ac/massage-params request)] + (cond + (:docid params) (get-data-google (:docid params)) + (:uri params) (get-data-uri (:uri params)) + (:file params) (get-data-file (:file params)) + :else (get-data-file "data.csv"))) + 200)) + +(defroutes json-routes + (GET "/get-pin-image-names" request (get-pin-image-names request)) + (POST "/get-pin-image-names" request (get-pin-image-names request)) + (GET "/get-data" request (get-data request)))