HARPgroup / r-dh-ecohydro

A set of R scripts for generating Ecological Limit Functions (ELF), storing the modeled output with REST in drupal VAHydro (dH), and a set of scripts for querying and analyzing processed ELF data
0 stars 1 forks source link

Leaflet cannot render geometry for NHD HUC8 02080201 #24

Open rburghol opened 6 years ago

rburghol commented 6 years ago

Leaflet would cause the whole page to crash when rendering the poygon outline for this watershed, but containment querie with postgis were fine, and mapserver could render the outline no problem.

Eliminated the crash by simplify(), but the geometry doesn't show up in the leaflet map (grey) but at least the page continues. Not a good long-term solution:

update field_data_dh_geofield set dh_geofield_geom = st_setsrid(st_multi(st_simplify(dh_geofield_geom,0.005)),4326) where entity_type = 'dh_feature' and entity_id = 74553;

rburghol commented 6 years ago

The above didn't actually work when migrated to live. But downloading and exporting the original shape as WKT then pasting into the drupal feature edit window did.

MULTIPOLYGON(((-79.6850847524976 38.4438170311047,-79.6815752395032 38.4443320153241,-79.6769289498238 38.4462279199686,-79.6723665840384 38.4508437037291,-79.671275583963 38.4535826563624,-79.669673416408 38.4590491175213,-79.6697497108904 38.461768996636,-79.6703295486421 38.481254470012,-79.6674532744492 38.483569991304,-79.663394446864 38.4854544518442,-79.6580767715438 38.4846419214881,-79.6538958729142 38.4824484707081,-79.6491198828674 38.4798087003723,-79.6448550604222 38.4748953704809,-79.6405063140079 38.4668120272051,-79.6403995017671 38.463188064851,-79.637919953412 38.4586981662997,-79.6349444964995 38.457389725244,-79.6324878365318 38.4538039099339,-79.6341281512056 38.4496954809798,-79.6354938057808 38.4360731971719,-79.6307330747001 38.4338873758115,-79.6112552779201 38.4310492416945,-79.6059833796078 38.4315947435674,-79.6052814759429 38.427528276356,-79.6028553338127 38.4248503589884,-79.5973850699199 38.418598070429,-79.5938374101481 38.4177512077651,-79.5879399028247 38.4169463068511,-79.5601994937438 38.4124258916198,-79.5337560807376 38.4119604995409,-79.5238455240812 38.4148405963218,-79.5186499210579 38.4180983479486,-79.515216703546 38.421329396627,-79.5004538699856 38.4401587426831,-79.4880332546857 38.458946126988,-79.4851569814188 38.4612578336216,-79.4804954344309 38.4626921599715,-79.4652900936632 38.4661101293306,-79.4593925876499 38.465297599082,-79.4528313253771 38.4617766338422,-79.4342843149967 38.4493750540348,-79.4294396613611 38.4440115899739,-79.4258538553004 38.4417990657564,-79.4257470428075 38.4377211544373,-79.4262200625272 38.4331778500306,-79.4297906028163 38.4127234433897,-79.4290963285928 38.4086569761895,-79.4249383196658 38.4069060303626,-79.4062082096949 38.4094656930931,-79.4003946283262 38.4118231762577,-79.3817331844376 38.4170950887453,-79.3770334909947 38.4171675682328,-79.3735239798299 38.4176749231434,-79.3676188451928 38.4164046292773,-79.3616755633135 38.4137724885104,-79.3483775627866 38.3990134256929,-79.3470881974255 38.3945006389566,-79.3458293498508 38.3908957501561,-79.3428462647947 38.3891257308103,-79.3356441355787 38.382884886561,-79.3326686799423 38.3811148672177,-79.3453258047629 38.3709563278371,-79.3475459504092 38.3659361861808,-79.3486293200663 38.3622969649783,-79.3473628431085 38.3586882614808,-79.3571436957493 38.3508337993877,-79.3743784433216 38.336067105559,-79.3810922871386 38.3232726107504,-79.3850900771204 38.3191298493696,-79.392818625843 38.3004263885277,-79.3950464012845 38.2958563811509,-79.4098702678869 38.2793082238937,-79.4177666654455 38.2673987388011,-79.4159203561373 38.2642554283836,-79.4057503991739 38.2562560088159,-79.4056435866708 38.2521742827995,-79.410671340591 38.2425765043562,-79.4152642221357 38.2388800625301,-79.418720327524 38.2365607264556,-79.4394951077848 38.2244452471141,-79.4405861072395 38.2212561601902,-79.4433937153524 38.2166785234003,-79.4474449122264 38.2147978774866,-79.4763297240023 38.2215918519461,-79.4798010886806 38.2197226501599,-79.4826392149205 38.2165030455868,-79.483699696719 38.2124060607301,-79.4865073050846 38.2078284239497,-79.5030630428913 38.1921462029966,-79.5117147521533 38.1870154348859,-79.5175435941077 38.1860159839803,-79.5210149591971 38.1845969164769,-79.5319478513061 38.1776160201386,-79.528926617824 38.1740416489632,-79.5276753995687 38.171340843382,-79.5275991050361 38.1686209642686,-79.5286595869621 38.164523979415,-79.5291707542937 38.1617964708842,-79.5290715713769 38.158172508531,-79.5284078149807 38.155460258835,-79.5271642260982 38.1527632679508,-79.5253255458493 38.1496199575156,-79.5187795411076 38.1456488579718,-79.516933231501 38.142501732841,-79.5156896426335 38.139804741958,-79.5161626626816 38.1357153865214,-79.5208776105133 38.1156920406355,-79.5291173297666 38.0960616084251,-79.5325200299621 38.092376610779,-79.535373415439 38.0896109551848,-79.5457188462694 38.0830916372413,-79.5491368054567 38.0798605885678,-79.5525166174069 38.0752715076868,-79.5540577490376 38.0675391163673,-79.5617405250466 38.0497282947687,-79.5680423879068 38.04508962272,-79.5708499969598 38.0409621202275,-79.5810809868828 38.0308150252591,-79.5856662408067 38.0275610883696,-79.6026568556156 38.0082320169748,-79.6143984604394 37.9898947670491,-79.6220583493742 37.972087760178,-79.6219439076329 37.968006034157,-79.6237139176951 37.9484785990334,-79.6295503852664 37.9284323649563,-79.6376604065323 37.9060744242937,-79.6398729246469 37.9019545512266,-79.644923570151 37.8950652078897,-79.6548875313446 37.8767584756248,-79.6524537592095 37.8731726603125,-79.6477464334196 37.8718947368889,-79.6390107971704 37.872047325051,-79.6312974962812 37.8676489794026,-79.6152910620158 37.8584059685636,-79.6185869507734 37.8515471428531,-79.6213640424463 37.8465155571287,-79.6236299666393 37.8442076652363,-79.6348069988988 37.8276900259126,-79.6487229761287 37.8052329029397,-79.6655991525067 37.7845305406109,-79.6672242087552 37.7804221116561,-79.6694748742809 37.7776640854988,-79.6817429080592 37.7593077621148,-79.6855118177544 37.7488135299527,-79.6830856749714 37.7456816636043,-79.6812241058781 37.7416342699071,-79.6805069432564 37.7371138537216,-79.680934186988 37.731662651381,-79.6767685462072 37.7285651173594,-79.6714508696132 37.7259406058285,-79.6736557585641 37.7218207327651,-79.6826965682681 37.7125929799241,-79.68554995492 37.7107275929009,-79.6866028080678 37.7070807423277,-79.6842148123839 37.7048567739167,-79.6806595219803 37.7026518790262,-79.677066084358 37.6990889519272,-79.6758224951695 37.6963919610288,-79.676303145122 37.6932105035326,-79.6798050243033 37.6736563654767,-79.6825515987539 37.668167016096,-79.6869613768011 37.6599234552743,-79.6857025287215 37.6567725154062,-79.6803924813755 37.6541480038725,-79.6745026013914 37.6515311217525,-79.6749222157481 37.6460837341088,-79.674212682498 37.6415633179232,-79.6694672090213 37.6384734133161,-79.6659653247586 37.6380843143052,-79.6584275002373 37.63866796321,-79.6549637632691 37.6396368964111,-79.6497910461018 37.6415442451828,-79.6469681773206 37.6443137154538,-79.6447632884432 37.6484335885217,-79.6330140522231 37.6645087229859,-79.6290086300157 37.6668433178156,-79.6101335551271 37.6780547135774,-79.6032365995265 37.6808928485462,-79.5997118272591 37.679595851614,-79.5920900796748 37.6774596214388,-79.5891451400579 37.6761473656999,-79.5856051089844 37.6743964198028,-79.5630526686024 37.6580046666792,-79.5361514877841 37.6525649094852,-79.5273090401606 37.6481780080372,-79.5232120651066 37.6468848258462,-79.5191150902065 37.6460455926256,-79.5150333742123 37.6456603083748,-79.5115467496531 37.6457175289779,-79.4923893886292 37.6469382329013,-79.4882847844223 37.6456488654193,-79.4847600127427 37.6443442391244,-79.4629934031656 37.6347235737114,-79.4548070833949 37.6325873436452,-79.4519918446907 37.634487062991,-79.443172285581 37.6276892729606,-79.4556920866924 37.6185072961688,-79.4548833714975 37.6135443751243,-79.4571416657488 37.6112402978995,-79.4570730005721 37.6085242334827,-79.4547918114812 37.5881575651354,-79.4546544811256 37.5827216216045,-79.4522588566474 37.5800398895709,-79.4481695115307 37.5791968416769,-79.443477445574 37.5774573399663,-79.4439504655861 37.5733717992222,-79.4479558866142 37.5710410190324,-79.4520147139678 37.5709761689895,-79.454883358478 37.5695685455821,-79.4605672413868 37.5649451322898,-79.4633977386691 37.562179476676,-79.4804722762587 37.5492056906635,-79.485095677348 37.5482253132737,-79.4932133326114 37.5480917985165,-79.497760439263 37.54438772732,-79.4999958453378 37.5411795668624,-79.5079532821116 37.5347022106451,-79.5084568201184 37.5319708874145,-79.5095173022822 37.5283278515249,-79.5094181193666 37.5247000744731,-79.5144992819466 37.5191763926859,-79.5195422974433 37.5127448129638,-79.5223956834385 37.5108832406028,-79.5258517903891 37.5099219367618,-79.549571519413 37.5072554624579,-79.5530505148965 37.5071982418643,-79.5576968050708 37.5075720820126,-79.5634493542041 37.5056609184856,-79.5650896690957 37.5020064384864,-79.5790056458239 37.4809111623379,-79.579493925054 37.4777297048381,-79.5792955592982 37.4704779654292,-79.5780214523261 37.4664191276336,-79.5784944726806 37.462783721165,-79.5807527674974 37.4604796439606,-79.5853761695322 37.4599455861805,-79.5888704241122 37.4603384998674,-79.6139481868017 37.4653471964344,-79.6179917564235 37.4648245827769,-79.6261094134884 37.4646834387058,-79.6301911304255 37.465515042564,-79.6342881062601 37.4668044100894,-79.6390030620187 37.469440365715,-79.6408188544857 37.4721297271968,-79.6420700731649 37.4752844817581,-79.647570856583 37.4847067837175,-79.6505234260354 37.4864653590425,-79.6552307523912 37.4886549950991,-79.6593124694826 37.4894865989659,-79.6645462224652 37.489845180343,-79.6726791389212 37.4901503558733,-79.6772872827015 37.4891623491549,-79.68069761389 37.4868353837486,-79.6971541784297 37.4742964735037,-79.7194243296797 37.4625548348367,-79.7409849485449 37.4467429142834,-79.7596540338267 37.4314383485596,-79.7801618008082 37.4197195982024,-79.8047970629829 37.4101828545909,-79.8277614926132 37.4033926930496,-79.8324001551946 37.4033049549194,-79.8561122661275 37.4019431075492,-79.880465246096 37.4023703531981,-79.8857371479178 37.4040831521605,-79.8933512695861 37.4066542579608,-79.895220468548 37.4106978369866,-79.8964945757824 37.4143027258418,-79.9028727413427 37.4323119113301,-79.912760421915 37.4511641448528,-79.9157206217528 37.4529150908329,-79.9204279497335 37.4550894681789,-79.9456659414277 37.4641074120539,-79.9502893458085 37.4635619102884,-79.9767480360568 37.4571227010379,-79.9894738428104 37.4559554035383,-79.9929604699009 37.4563445026157,-79.9964242086752 37.455814259663,-79.9980721543703 37.453060048249,-80.0008645071014 37.4498289996695,-80.0024743057193 37.4461668903168,-80.0128884070708 37.4282721455273,-80.0239052298908 37.4112662251895,-80.0273079334061 37.4089278157577,-80.0375770795462 37.4041785176167,-80.0415977632735 37.4031866963019,-80.0609611312363 37.3932570392611,-80.083154999915 37.3814543658794,-80.1075995366083 37.3682326251377,-80.1291449088688 37.3550681048939,-80.1331198165063 37.352714436686,-80.1377279632152 37.3521613055665,-80.1417333885896 37.3507117206024,-80.1450826866981 37.3470114642785,-80.1558935204195 37.3417853290345,-80.1627904817869 37.3402747089073,-80.1844350380526 37.3302687580149,-80.1890279261873 37.3292616779352,-80.215456106911 37.3236845905383,-80.2207203812869 37.3249281818273,-80.2237110998332 37.3275793963966,-80.2371082993376 37.3454169206194,-80.2406635921845 37.3476065568262,-80.2440815555259 37.3461684159706,-80.2480869813738 37.3447188310238,-80.2502842431461 37.3414954118668,-80.254282039639 37.3400420122237,-80.2595386848262 37.3412856035212,-80.2631092365925 37.3439215593068,-80.2666874177534 37.3465613297902,-80.2700748635053 37.3442191056951,-80.2751941792642 37.3418349199325,-80.2955341130151 37.3282126361605,-80.3006839466049 37.3267363483427,-80.3242511116898 37.3221053059629,-80.3316287251016 37.318305867545,-80.3504961901973 37.3119696555119,-80.3626269104903 37.3112296042965,-80.3873155964495 37.3061064660296,-80.4100740480264 37.2960394801629,-80.418168824773 37.2958449306509,-80.4253862212139 37.2879599515219,-80.447671652236 37.2806204741969,-80.4534165786828 37.2795676178012,-80.4598252619582 37.2807730621711,-80.4656998884737 37.2828940338734,-80.4675614587999 37.2860259003126,-80.4625184361347 37.2902296966224,-80.4696900585856 37.2959517425198,-80.4675462020865 37.3000830596033,-80.4647233300277 37.3019675200136,-80.4454743942715 37.3128699245582,-80.4263322706869 37.3264845788438,-80.422944824377 37.3288344323159,-80.3983400612111 37.336231130101,-80.3725374852953 37.3431929524157,-80.3656176341316 37.3438109333364,-80.3487032920073 37.3560027056103,-80.3464755123076 37.3583220415168,-80.3255328560765 37.371055500795,-80.3039798495879 37.3833464552077,-80.2801227699605 37.396140949667,-80.2772770102487 37.3975676464264,-80.2733249902141 37.4003790782784,-80.2705631541219 37.4040717051916,-80.2678928710204 37.4100264475607,-80.266847646071 37.4132269785334,-80.262300534132 37.415595905508,-80.2406407174698 37.4256094857228,-80.2349797160075 37.4293669624926,-80.2366276649791 37.4424780768605,-80.2385121232506 37.4465216559205,-80.2421055631305 37.449611560674,-80.2510166833911 37.4553069036352,-80.2563191049427 37.4574545781764,-80.2610188051837 37.45915974784,-80.2802601098938 37.4618948857736,-80.2837391086261 37.4618147771373,-80.3036365384843 37.45092763129,-80.3199634169362 37.4378508492369,-80.338624887241 37.4256247446821,-80.3594683611299 37.4097136426253,-80.3645266419667 37.4055136609989,-80.3878801846608 37.3949850967605,-80.4130724099357 37.3871268206102,-80.4375703614543 37.376556294745,-80.4644639406732 37.3681944786113,-80.4854294881 37.3563383997873,-80.5016953346856 37.3432349149401,-80.5062195595351 37.3404082243321,-80.5349594521882 37.3351553865099,-80.538499487131 37.336879629692,-80.539193761556 37.3395842500349,-80.5412231790094 37.3467902131225,-80.5419327122682 37.3499487824361,-80.5409485221545 37.3540533966461,-80.5367142147498 37.3636855071109,-80.5229508066315 37.3817175807861,-80.5190293032071 37.3849905909728,-80.5078522557294 37.3952444970248,-80.4958817536744 37.414588826571,-80.4920670621459 37.4205817158858,-80.4819123520875 37.4276312762804,-80.4785096467953 37.4295309954726,-80.4733521829871 37.4310187273503,-80.469331497439 37.4320219926896,-80.4665086254155 37.4339064530987,-80.4637773063489 37.4380530289656,-80.463884118134 37.4407729080908,-80.4862153280131 37.4479369096686,-80.4903046783417 37.4487418108188,-80.5003144337359 37.4666365556101,-80.5022675570195 37.4720305375103,-80.5018708296639 37.4765776566043,-80.500261029936 37.4797896316571,-80.4963318972536 37.483062641845,-80.4900681728071 37.4859351088038,-80.4696519412636 37.4977759288321,-80.4662644948726 37.500125782298,-80.4417055078622 37.5102461738591,-80.4371583951566 37.5126227301999,-80.4171465214614 37.5203627507406,-80.3955248487173 37.5317610659261,-80.3743914566782 37.5408781921859,-80.3487948764165 37.5546339902694,-80.3380450761401 37.5621413143695,-80.3352298339918 37.5644759090619,-80.3336124052068 37.5676878841214,-80.3308810866609 37.5722845942704,-80.3320712730662 37.5881308465579,-80.3321780848774 37.5908469109843,-80.3342303903566 37.5989607719951,-80.33553501552 37.6025618461829,-80.3422641332309 37.6114729789338,-80.3446902776311 37.6141394523062,-80.3420505120346 37.6210020926074,-80.3335132326693 37.6257361318319,-80.3284091756834 37.6290282155196,-80.3261661373398 37.6313475514255,-80.3234195599991 37.6354941273016,-80.3223590761614 37.6382407093015,-80.3236255542428 37.6409300708513,-80.3289432348195 37.6430701160156,-80.3353137698922 37.6424673938786,-80.338785139287 37.641933336281,-80.3433627690804 37.640014543595,-80.347497895237 37.6417311573656,-80.3388461770812 37.6587103746877,-80.3239002182256 37.6785582443021,-80.3222751601033 37.6817702193615,-80.3045826218256 37.6907957929412,-80.3005619371386 37.6922491925727,-80.2789326383042 37.7049864665585,-80.2575474814406 37.7245177163211,-80.2565022565524 37.7277182472926,-80.2577839934013 37.7308615578089,-80.258485897162 37.7340201271134,-80.2580891701196 37.7390173804794,-80.2587758150361 37.741722000814,-80.2578374019761 37.7476385962108,-80.2536488730625 37.7604292760049,-80.2514210937916 37.7631987461884,-80.2486668873621 37.7673453220701,-80.2315160368526 37.7763441928127,-80.227495352526 37.7777937777569,-80.2246877402659 37.7805785067311,-80.2230855706784 37.7846945650376,-80.2240545040923 37.7951010590702,-80.2225896640364 37.8028448944385,-80.2186529033726 37.806560409536,-80.2146551074275 37.8089140777244,-80.2084981971289 37.8158530119795,-80.2098333398387 37.8203581694026,-80.1968862804203 37.8328894497956,-80.1929113728185 37.835697066957,-80.1788885713292 37.8509672999672,-80.1678412293768 37.8679884790049,-80.1651022822099 37.8730353234391,-80.1623557055891 37.8776282189038,-80.1548941707918 37.8809660789926,-80.1508582281075 37.882411849251,-80.1451285629674 37.8852576133963,-80.1246589349636 37.9002112265843,-80.1031440829896 37.9188078756433,-80.0885109327785 37.9340819234015,-80.0698570995687 37.9517020099852,-80.0487618643936 37.9662016742714,-80.0306115709999 37.9819945209127,-80.008349041998 37.997413527277,-80.0049539684258 38.0006560199474,-79.9968134235017 38.0189589372995,-79.9957376814663 38.0217017046131,-79.9794565884859 38.0415266862421,-79.967226696431 38.0603636612575,-79.9538066213053 38.0787695755069,-79.9415538415575 38.0971526015667,-79.9387920072516 38.1021956313283,-79.9419276874709 38.12615955924,-79.9425990734619 38.1288679942596,-79.9433086065475 38.1324805125205,-79.9428432151856 38.1361159189788,-79.9311168626329 38.1531256540362,-79.9254253467319 38.1582259042945,-79.9210003084419 38.1660193307763,-79.9199779726244 38.1705740792726,-79.9201000434954 38.1741980416317,-79.9219921304546 38.1782416206622,-79.9215191097434 38.181880841818,-79.9158657410437 38.1878813606224,-79.9124096326819 38.1897658210963,-79.9056271162661 38.1971510750103,-79.9033993383923 38.2008246284657,-79.8970898428626 38.2050284248932,-79.8918713479646 38.2064894540045,-79.8769101379042 38.2149390085747,-79.8752240457182 38.2172392710252,-79.8551816712968 38.231681715027,-79.8344831705604 38.2443159925797,-79.8143110971584 38.255126844875,-79.8102370095076 38.256111036836,-79.7999220922659 38.2635573260123,-79.7799483854571 38.2811583393959,-79.777125516622 38.2848357075759,-79.7784530295479 38.289798628631,-79.786898752498 38.2973479142532,-79.7910872815293 38.299991499341,-79.7940932569165 38.3022040236679,-79.7990676134322 38.3111761914304,-79.8003646086469 38.3152312145499,-79.785632284201 38.3318289624518,-79.771495051816 38.3493193495025,-79.7669326851149 38.3534811842679,-79.7610809527804 38.3540457595846,-79.7563431091278 38.3527716508186,-79.7487595084817 38.3542670123005,-79.7412216846449 38.3575819843586,-79.7378266128654 38.3617209309215,-79.7350037442711 38.3653982991079,-79.7363388866274 38.3708151691279,-79.7375977345279 38.3735159747295,-79.7382920086399 38.3766745440109,-79.7378571354058 38.3816679826814,-79.7225526098517 38.4000777118293,-79.719752629713 38.4046591632584,-79.7123216184905 38.4115942829878,-79.7065766989028 38.4157790059826,-79.7025712771167 38.4194792623878,-79.6929582658706 38.4318884726917,-79.6850847524976 38.4438170311047)))

rburghol commented 6 years ago

wget https://github.com/jalbertbowden/us-data/raw/master/shapefiles/huc/huc-08-usa/huc-08-usa.zip unzip huc-08-usa.zip shp2pgsql -s 26915 huc_08_USA huc_08_USA vahydro > huc_08.sql cat huc_08.sql | psql dbname copy(select st_astext(st_transform(the_geom,4326)) from "huc_08_usa" where huc = 2080201) to '/tmp/huc02080201.txt';

rburghol commented 6 years ago

image