frederickjansen / polyline

A Python implementation of Google's Encoded Polyline Algorithm Format.
http://goo.gl/PvXf8Y
MIT License
114 stars 19 forks source link

Encoded my points, but moved decimal over two places. #9

Closed rgregory1 closed 4 years ago

rgregory1 commented 4 years ago

I had a polygon it encoded, here are the first two points: [(45.01659550333779, -72.84230558748105), (45.01648444523865, -72.83481118517622)]

It produced a polyine for me, BUT they were in the wrong place.

It encode them as:

(0.45017, -0.72842), (0.45016, -0.72835)

Any ideas?

frederickjansen commented 4 years ago

Hi @rgregory1, these coordinates work fine for me. Are you encoding and decoding with the same precision level?

rgregory1 commented 4 years ago

Thanks for responding, here is a video of my experience, it's two minutes long, perhaps you can shed some light on what I am doing incorrectly? https://www.youtube.com/watch?v=m0uLJbppugE&feature=youtu.be

frederickjansen commented 4 years ago

Two points:

rgregory1 commented 4 years ago

First Point - Thank you, I swap because the one service that's worked for me uses them in reverse.

Second Point - at 2:14 in the video, I use 5 (after using 3 first) and that's what I paste in. I have managed to get your polyline to get close (by deleting one carriage return, it seemed to show most points). But not all points are encoded.

Is it possible for me to give you a python list of coordinates to test?

frederickjansen commented 4 years ago

Sure, if you send me the list I'll give it a try

rgregory1 commented 4 years ago

I'll put it here, I looked for an email and couldn't find one. If this isn't the best place, let me know and I'll edit it out. Thank you for your help!

These are the exterior coordinates for a town in Vermont called Alburgh. Top-left town shape on this site: http://geodata.vermont.gov/datasets/0e4a5d2d58ac40bf87cd8aa950138ae8_39/data?geometry=-74.078%2C44.805%2C-72.522%2C45.145

[(44.84049866466681, -73.29363143847105), (44.83998748957583, -73.29493071714107), (44.84001076920691, -73.29649737943431), (44.84016655531458, -73.29790030806764), (44.84045719829934, -73.29930599431103), (44.84103180154867, -73.30038183846469), (44.84180503563529, -73.30214474218161), (44.84255664362435, -73.30365214230432), (44.84322674977405, -73.30511442859282), (44.84397256419244, -73.30628978813354), (44.84461190006033, -73.30750467375218), (44.84534700480192, -73.30851145431417), (44.8458847733308, -73.30957912310625), (44.84660992682217, -73.31050194633714), (44.847454675174845, -73.31103104109776), (44.84842929282087, -73.31178549994965), (44.84958843130209, -73.31228008713694), (44.85079351546369, -73.31276711793154), (44.851759903209135, -73.31302018803106), (44.85292123799652, -73.31359721798682), (44.85381599085304, -73.31444377956429), (44.85446772441489, -73.31591380914873), (44.85544704741935, -73.31825652526167), (44.85630451683613, -73.31778373052518), (44.85742037509049, -73.31716794157173), (44.858325267112974, -73.31685823858443), (44.85930388009036, -73.31667141011363), (44.86034665199707, -73.3165478595225), (44.86137032268418, -73.31637721945744), (44.86241296962311, -73.31628364555667), (44.86335808263636, -73.31625107073282), (44.864554347650056, -73.31620673352676), (44.86586834171802, -73.3161841780051), (44.86706380947801, -73.31610021984005), (44.86801728022652, -73.3160061324211), (44.869437509567625, -73.31587586440523), (44.87040697004764, -73.31569746201471), (44.87142131047862, -73.31553500024187), (44.87258068606772, -73.31538875492265), (44.87373073287927, -73.31525085153304), (44.87536571950823, -73.31501310038759), (44.87626538747758, -73.31492986760966), (44.87731524648184, -73.31472041755448), (44.87823068858397, -73.31454513466772), (44.87929082819017, -73.31439555571843), (44.880358901820884, -73.31415545970506), (44.881346542823785, -73.3139886451259), (44.88248627135027, -73.31379549016947), (44.8835825480434, -73.31362576497142), (44.88480304839058, -73.31334930599016), (44.885798358503855, -73.31309092896272), (44.88674913756247, -73.3128938154353), (44.88778281331193, -73.31278267547005), (44.88890317722783, -73.31242704477444), (44.890076498970764, -73.31206493014703), (44.8911991440642, -73.31185640549427), (44.89218554034818, -73.31159810347312), (44.8932898673773, -73.31143450054948), (44.89432476571729, -73.31141689821433), (44.89527951415376, -73.31142045033378), (44.896402730772664, -73.31129584273592), (44.89735154616594, -73.31150112124548), (44.89825545058435, -73.31179592026972), (44.899253431370376, -73.31232552367024), (44.900381668045334, -73.31311413296267), (44.90116536695619, -73.31374673362733), (44.901905182699565, -73.31450066403696), (44.9029283907611, -73.31550312068723), (44.903677765982216, -73.31626508276294), (44.904548205195574, -73.31724846987578), (44.90542803973641, -73.31830090388546), (44.90614209774739, -73.31911625033509), (44.90695680473568, -73.32005017880682), (44.90796322276897, -73.32115312827347), (44.90878489475712, -73.32197970421375), (44.909651868980205, -73.32280011203883), (44.91073683647876, -73.32368862264427), (44.91160086742617, -73.32429173136372), (44.912571848619116, -73.324813439038), (44.913559721459784, -73.32531349718188), (44.914482277986664, -73.32556226123222), (44.915530766526, -73.32589262463597), (44.91676745833452, -73.32610550718742), (44.917786405521205, -73.32620281160769), (44.91880369635064, -73.32625538716762), (44.91982074710303, -73.32622918129628), (44.92107364114487, -73.32634175340173), (44.92238096111686, -73.32649386964614), (44.92348977015655, -73.32657107430225), (44.92468916213138, -73.32672760817867), (44.92568919779131, -73.32680174062166), (44.92673477289495, -73.3268377678393), (44.927781230911265, -73.32697552822493), (44.928873125129854, -73.32717639729537), (44.92983776348835, -73.32727967851174), (44.93094774321663, -73.32748069411227), (44.93214939994991, -73.32780857769916), (44.93314359177133, -73.32806787049782), (44.93435517769384, -73.32840365022939), (44.935287015966466, -73.3287236383687), (44.9362528394278, -73.32893605763493), (44.93716720053164, -73.32927089042833), (44.93818864655003, -73.32953125824015), (44.9393632415934, -73.32984236731085), (44.94033909445178, -73.33006117424748), (44.94128778354309, -73.33035245171706), (44.94233663669566, -73.33066723021975), (44.94328624493215, -73.33098033524512), (44.944174193153586, -73.33138239805184), (44.9450832816488, -73.33195812032825), (44.945867569075865, -73.33266764029415), (44.9466038423192, -73.33374104406772), (44.946900645546656, -73.33499387029111), (44.947069276495604, -73.33665439458667), (44.947343315930816, -73.33820900726516), (44.94759592618806, -73.33945641322838), (44.94887255617938, -73.3393611011627), (44.950373454075475, -73.33915284858838), (44.95150551077631, -73.33901575428986), (44.95305169196625, -73.33885363967102), (44.9543375251084, -73.33875476583815), (44.95573004936332, -73.33856239081058), (44.95688931835474, -73.33843238709653), (44.95829123117913, -73.33830933380467), (44.95959540063069, -73.3381640658867), (44.960987575040036, -73.33801905904242), (44.962346019822384, -73.33795771648121), (44.96371572564444, -73.33802949900023), (44.964798285410865, -73.33818671994302), (44.96604218118044, -73.33888451086011), (44.96710413921878, -73.34009343703438), (44.967882702266984, -73.34109646032788), (44.968746126801534, -73.3422685879341), (44.969509881415284, -73.3434098804834), (44.97052786196156, -73.34470604173897), (44.97158911337419, -73.34589259538504), (44.97278910371495, -73.34728648053151), (44.973966584951754, -73.3484496147448), (44.975205925718456, -73.34949707464988), (44.976498738530616, -73.35050429361569), (44.977890170701336, -73.35145076709085), (44.979025755190285, -73.35215703918551), (44.98029495503038, -73.35281650665476), (44.981537034637526, -73.35338367708692), (44.982539615505935, -73.35364339114346), (44.9839703862102, -73.35424751311811), (44.985469096740864, -73.35452654429692), (44.9867954521738, -73.35476143727476), (44.98810761439306, -73.35460822962193), (44.98927120274668, -73.35413096657234), (44.99055469249155, -73.35325080793501), (44.99159716467733, -73.35249473955201), (44.99266594801973, -73.351685009953), (44.99393090291558, -73.35076566490437), (44.99534903757856, -73.35049495789637), (44.99662781650598, -73.349917416112), (44.99791836126045, -73.34952392361005), (44.99913332678352, -73.34889897281855), (45.000133679619964, -73.34832130855344), (45.00156323675614, -73.34754130893788), (45.00263627575533, -73.34708706743713), (45.003664153951256, -73.34659447235212), (45.00469337139517, -73.3461394251745), (45.00586258775052, -73.34549234818682), (45.00705958803894, -73.34485986066426), (45.008204315489564, -73.34433516352922), (45.00907045992024, -73.34382030902853), (45.0100712941636, -73.34331997444193), (45.01071593435493, -73.34293288213343), (45.01084152089266, -73.33503000734997), (45.010967935294936, -73.3286737529303), (45.01102349827697, -73.32585704599742), (45.01113184469941, -73.3202597393046), (45.01119852133355, -73.3169124701677), (45.01137183610682, -73.30811792788926), (45.01137354482601, -73.30791789084755), (45.011434663117285, -73.30489840133579), (45.011468000150565, -73.30317337756742), (45.01160135222997, -73.2963371635822), (45.011604128783674, -73.29608438362577), (45.011654136653235, -73.29350378949572), (45.0117541493144, -73.2883064900902), (45.01187333100009, -73.28220556676823), (45.01190138996244, -73.28070637822188), (45.01191250263422, -73.280114702898), (45.011926394993104, -73.27938691235539), (45.01206252281901, -73.27237014316766), (45.0120958613839, -73.27018122035068), (45.01240146946626, -73.2499809190465), (45.01246260039353, -73.2460253737559), (45.012493170119896, -73.24392538083268), (45.012509842890026, -73.24292816394265), (45.012526517016006, -73.24181705762577), (45.01257653790026, -73.23844207000876), (45.012757166797314, -73.22633934354153), (45.0129433368181, -73.21675882344607), (45.0130072446271, -73.21351717019454), (45.013023918048304, -73.21262828410445), (45.013029475331656, -73.21229773053214), (45.013071153960695, -73.21021301648612), (45.013403203857706, -73.19305696995673), (45.01347087005107, -73.19231085444689), (45.01177214754949, -73.19304633861566), (45.01074700491264, -73.19367193569778), (45.009710828134565, -73.19415809154523), (45.008721058607435, -73.194766442036), (45.00674047196626, -73.19591710735601), (45.005757748773945, -73.19635703144382), (45.00467030016892, -73.19705899714425), (45.00354858161697, -73.19783142436425), (45.00208556683353, -73.198687571994), (45.0009452547339, -73.1994673171566), (44.9999638773496, -73.20002295196159), (44.99911726018598, -73.20055522460807), (44.99826124357445, -73.20106441108089), (44.997370898230656, -73.2017121658947), (44.99567053209394, -73.20290891501296), (44.99480564530876, -73.20341006511019), (44.993122065536845, -73.20455213208902), (44.99223960643939, -73.20509981521039), (44.99050351511296, -73.20631976103661), (44.989604811916934, -73.20698981794988), (44.98825352812944, -73.20808631571302), (44.98693898773073, -73.20920540610062), (44.9859604834309, -73.2100001794275), (44.985042808113484, -73.21056300021304), (44.984206487361064, -73.21119654787347), (44.982925187873576, -73.21216057731742), (44.98208126606591, -73.21288590966219), (44.98081785157467, -73.21386555681613), (44.97904057597276, -73.21530953414134), (44.97775037215687, -73.21629584345895), (44.97700620934407, -73.21703700084075), (44.97565211398695, -73.21797806710958), (44.97467243770879, -73.21864878885137), (44.973676676749925, -73.2194437795778), (44.97258005487013, -73.22010715868362), (44.97121145786404, -73.220675578738), (44.970106248188365, -73.22140091461272), (44.96902640735396, -73.22197011396263), (44.968107862779604, -73.22253257067159), (44.967029492171235, -73.22326653596421), (44.9660170155363, -73.22413794778849), (44.964901018536594, -73.22473030430339), (44.96376399251232, -73.22568602692074), (44.96283873009619, -73.22639620734815), (44.96185378960702, -73.22730612758428), (44.96101160424898, -73.22813873284608), (44.959979672931624, -73.22896460180405), (44.95918400196944, -73.22986707397895), (44.95831135281194, -73.23105573885603), (44.95731793962197, -73.23260745886404), (44.95664994039934, -73.23364859561552), (44.95609825349312, -73.23465266481536), (44.95553150159945, -73.23584269558776), (44.954953263941036, -73.23690024629946), (44.95414546683691, -73.23816546161277), (44.95321479731855, -73.23912884129653), (44.95225275276698, -73.23982236419502), (44.95128880933471, -73.24037783581625), (44.95019556319012, -73.24066791494916), (44.9488856264858, -73.24094417066303), (44.94767818286619, -73.24088783300073), (44.946478229207166, -73.24067560851923), (44.945267913917256, -73.24040978749723), (44.94401807658962, -73.23995213902082), (44.942795507491425, -73.23949384718436), (44.941606179917486, -73.2387792992558), (44.94063851042748, -73.23794966166189), (44.939768697969505, -73.23695938171241), (44.93882307452464, -73.23580662350109), (44.93805507343203, -73.23501763270433), (44.937008061211614, -73.23424955921456), (44.93593955789759, -73.23388437286063), (44.934826826509855, -73.23352585852477), (44.93340895356024, -73.23322225792943), (44.93201832223947, -73.23296437171653), (44.930651331977224, -73.23244381142709), (44.92934430751844, -73.23177709247277), (44.92791702221625, -73.23101716658509), (44.92757063999369, -73.23350430748594), (44.92753221070369, -73.23508647187163), (44.927503847393716, -73.23670904483201), (44.927408839143574, -73.2381693812337), (44.92733946997683, -73.2394751212018), (44.9272368787276, -73.24098918717202), (44.926972771169105, -73.24259528406532), (44.926697965415215, -73.24403060193761), (44.9263091957491, -73.24567597163008), (44.925914270864425, -73.24691057674482), (44.92551857729347, -73.24812311464864), (44.9250777271364, -73.24930363526728), (44.924467370699155, -73.25057351054299), (44.92372121728933, -73.2518284145475), (44.92274733739786, -73.25293984215011), (44.92178059222685, -73.2538957867236), (44.920883888266275, -73.2546688351845), (44.91977864938079, -73.25540530985174), (44.91873527739423, -73.25601186135178), (44.91786848299188, -73.25645162835443), (44.91689471363144, -73.25698306542763), (44.91603826015849, -73.25747765186512), (44.91505714560092, -73.25807101495768), (44.91419959762902, -73.25847221896663), (44.91295093176257, -73.2592433744674), (44.91161457056159, -73.26018303615007), (44.91071318060161, -73.26070733071163), (44.90986620294826, -73.26124929632621), (44.90884210348207, -73.26195656725068), (44.908044785632235, -73.26276912959871), (44.907102430221265, -73.26356392081516), (44.906222767067824, -73.264321909121), (44.90528376745543, -73.26533942673693), (44.90446501616067, -73.26598978470312), (44.90339809094121, -73.26686550164794), (44.90221807801035, -73.26796366759017), (44.90122082279362, -73.26868716517855), (44.90033057216834, -73.26938193121734), (44.899191254191564, -73.27019325168082), (44.898372424904714, -73.27085094211458), (44.89738489180611, -73.27159776813899), (44.89628459588917, -73.27207883581607), (44.89528227443402, -73.27246979049004), (44.89443360308724, -73.27289444003185), (44.89319582012462, -73.27318637842066), (44.89205589949097, -73.27341834437661), (44.891051631038195, -73.27368414817535), (44.890020376528334, -73.27393502310196), (44.88899708146256, -73.27410016912044), (44.888063443484086, -73.27430081730385), (44.886976907515894, -73.27450257193873), (44.88603372658634, -73.27462409180329), (44.88484897084563, -73.27483198341633), (44.8837719750193, -73.27507308461013), (44.88260461309503, -73.27525043552941), (44.88154507239101, -73.27543872089947), (44.88063013014877, -73.27566855893359), (44.879625371461856, -73.27587300822869), (44.87856754683276, -73.27619254477655), (44.87757054337613, -73.27632823194713), (44.87666593306445, -73.276613107544), (44.875707011790325, -73.27686522409331), (44.87408409399078, -73.2773246794444), (44.872929839482424, -73.27779649704131), (44.87206294081419, -73.27823825331902), (44.8711868649609, -73.27858711204955), (44.87026657336374, -73.2790591272996), (44.86914134346976, -73.27965452661545), (44.86801337209304, -73.28011066930323), (44.86712883918519, -73.2804978300346), (44.866252928295815, -73.28093988687444), (44.86532406796682, -73.28146586709818), (44.864225870423205, -73.28205407039374), (44.86313723138353, -73.28267831614077), (44.862217659179976, -73.28317399952034), (44.86136932197673, -73.28364836482028), (44.8603962559149, -73.28422793756208), (44.85919017716538, -73.2847986319406), (44.8582614427191, -73.28531664477116), (44.85733227441149, -73.28576656800638), (44.85642637818586, -73.28599905781245), (44.855425201318546, -73.28646416992613), (44.854503684756494, -73.28687379986384), (44.85324991251189, -73.28729875196186), (44.852102770627404, -73.28764607236491), (44.85125473308605, -73.28808715059272), (44.85026417997702, -73.28870653895093), (44.84933109109616, -73.28948722162257), (44.84836156485039, -73.29030495134825), (44.8474275638907, -73.29042297731588), (44.84642194409782, -73.29061718209654), (44.84541722364936, -73.29081139266859), (44.844238106240276, -73.29084939776256), (44.84328900554662, -73.29119842141638), (44.84230960905857, -73.29189333804078), (44.84129273432997, -73.29254193029067), (44.84049866466681, -73.29363143847105)]

frederickjansen commented 4 years ago

Here's the code I tried in Google Colab. This results in the following string:

c|tpGddj~LdBbGCxH_@vGy@xGqBtE{C~IuClHeCbHsCjF_CpFsChEiBtEqCvDgDhBcEvCgF`BoF`BaEp@gFrBsDfDaCdHcEtMiD_B_FyBuD}@aEe@qEWkEa@oES}DEmFGgGEmFO_EQ{GYaEc@iE_@gF]eF[gIo@sDOqEi@uDa@sE]uEo@eEa@cFe@yEa@sFw@gEs@}Dg@mEU_FeAkFiA_Fg@eEs@{Ea@mEA_E?_FW}Df@uDz@eEhBaFzC}C~BsCtCkEfEuCxCmDbEoDpEmCbDcDxDgEzEcDdDmDbDyEpDkDvBaEfBeEbBwDp@qE`AwFj@kEPiEJkEEyFTeG\}ENoF^gELoEFqEZyEf@aER}Ef@oF`AeEr@sF`AyD~@_Ej@wD`AkEr@iF|@cEj@}Dx@qE~@}D|@oDnAuDrB}ClCqCtE{@xFa@jIu@vHs@xF}FSkHi@cFYsHa@aGSuGe@gFYwGWeG]uG[oGKqGLwE^wFhCsEpF{ChEmDhFwCbFkEbGsEjFoFvGkFfFwFpEaGfEuG|DcFlC{FbCyFnBgEr@}GxBkHv@iGl@eG]gF_B_GoDqEwCuE_D{FwD{Gw@_GqBaGoAqF{BgEs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HzDVpKlAjFD|DdAbEjChE`C~CxE

If you plot both here, you'll notice two differences: (1) there are fewer points plotted through the second string, 316 vs the original 377 points. This tool has the original amount of points. And (2), the other tool has a different rounding strategy. Try entering just these two coordinates into the official Google tool "44.84049866466681, -73.29363143847105" and you'll end up with c|tpGddj~L (same for us). The other tool returns a|tpGfdj~L. So I believe our behavior is correct both in terms of the rounding as well as the amount of points we generate.

rgregory1 commented 4 years ago

1 I really appreciate your taking your time to go through this with me.

They polyline that your colab produces is accurate on my Student Information System now, thbut the one from my notebook wasn't...Why do you think it wasn't accurate in the video I showed you? I'd love it if I could get the same results you did...

frederickjansen commented 4 years ago

Can you share your notebook? The only thing I see is from the video is the precision=3 thing.

rgregory1 commented 4 years ago

Thanks for your continued interest. Sorry about the slow reply. Here is my notebook and data. https://drive.google.com/open?id=1kZxq-afHZRkZ2pT2WZIP_OyCZJoBVUfL I tried to use a colab notebook but I have less experience with them.

frederickjansen commented 4 years ago

The result in your notebook matches the one in mine, so you should have the correct data. The only difference I can see is that yours has an extra backslash somewhere because you don't call the result with print(). Here's your project imported into Colab. You might have to reupload the files, since they get deleted automatically after a while.

rgregory1 commented 4 years ago

Ok, then I'll consider it case solved, thanks for all your help.

My last question is, how should the data be called, with or without the print statement in a notebook?

frederickjansen commented 4 years ago

If you want to actually print out the data, use a print statement. Otherwise certain characters can be escaped during output, which would invalidate the polyline.