I am using St_contains to find whether a point is in polygon, but the result seems to be inaccurate. If a point is not in the polygon, St_contains will still return 1.
here is my code
SET #i = ST_GeomFromText
(
'POLYGON((43.120825901794 -79.804519106556,43.121675995356 -79.808262109949,43.122060291437 -79.809953891553,43.122354803231 -79.811250508027,43.122502706668 -79.811978610103,43.122504906903 -79.811986283924,43.122508088955 -79.811996589915,43.122511303346 -79.812006400094,43.122515398461 -79.812018485988,43.122519502329 -79.812029908205,43.122524189401 -79.812042396061,43.122529607259 -79.812055910908,43.122534497156 -79.812067301339,43.122539412616 -79.812078511034,43.122544813239 -79.812089906984,43.122551308513 -79.812103104857,43.122556500525 -79.812113197823,43.122556947646 -79.81211402064,43.122561101914 -79.81212180938,43.122567611947 -79.812133297692,43.12257380731 -79.812143998195,43.122581413338 -79.812156209043,43.122588306761 -79.812166796322,43.122597209243 -79.812179886041,43.122606608303 -79.812192880573,43.122615299471 -79.812204285086,43.122624697158 -79.812215817893,43.122632697612 -79.812225210299,43.122640110139 -79.812233503458,43.122647597468 -79.812241602988,43.122654393768 -79.812248595486,43.122657689796 -79.81225190959,43.122665191582 -79.812259204694,43.122669705582 -79.812263383434,43.122673696679 -79.812267107346,43.122678788478 -79.812271587283,43.122683499255 -79.812275714497,43.122688998725 -79.812280192156,43.122693910958 -79.812284301463,43.122704110012 -79.812292282669,43.122706800281 -79.812294188955,43.122715799598 -79.812300708994,43.122730907194 -79.812312591598,43.122740295329 -79.812321516184,43.122746889145 -79.812328700988,43.122754011258 -79.812337105016,43.122760200793 -79.812345405227,43.122766789948 -79.812355097555,43.12277320192 -79.81236570656,43.12277941111 -79.812377413051,43.122783094344 -79.812385116304,43.122788695772 -79.812398304727,43.122793496059 -79.812411598466,43.122796593147 -79.812421300181,43.122799710508 -79.812432597886,43.122802193416 -79.812443191512,43.122803993055 -79.812452188659,43.122805891151 -79.812463701229,43.122806890277 -79.81247099346,43.122808511891 -79.812488705099,43.122809106538 -79.812503100133,43.122809109847 -79.812515282914,43.122808503102 -79.81253020137,43.122807204003 -79.812545092356,43.122805708405 -79.812556588469,43.122803493502 -79.812569317318,43.122800909017 -79.812581411864,43.122799110463 -79.812588392426,43.122797795926 -79.812593192326,43.122789308453 -79.812618807415,43.122785206163 -79.812630081095,43.122779307318 -79.812647986598,43.122773098226 -79.812668584165,43.122767591602 -79.812690007256,43.122761402516 -79.812718188204,43.12275719202 -79.812741395308,43.122753597693 -79.812765903096,43.122750802611 -79.812793195292,43.122750127663 -79.812802910099,43.122748997299 -79.812819183992,43.122748294917 -79.81283959272,43.12274821248 -79.812861510037,43.122748690312 -79.812882514783,43.122750411098 -79.81291109605,43.122752695783 -79.812933890352,43.122755301773 -79.812954616298,43.122758590734 -79.812975302669,43.122763193312 -79.812998986918,43.12276340289 -79.813000115557,43.122763695683 -79.813001292097,43.122763890121 -79.81300249433,43.122764303539 -79.81300489243,43.122764692381 -79.813007296966,43.122764989888 -79.813008507055,43.122765208902 -79.813009702853,43.122765792147 -79.813013309692,43.122766294518 -79.813015614871,43.122766513532 -79.813016810669,43.122766707928 -79.813018012913,43.122766902374 -79.813019215204,43.122767286494 -79.813021586131,43.122767608576 -79.813022789786,43.122767803022 -79.813023992078,43.122767997417 -79.813025194322,43.122768191856 -79.813026396555,43.122768694226 -79.813028701735,43.122768888629 -79.813029904037,43.122769107643 -79.813031099835,43.122769690888 -79.813034706674,43.122770013004 -79.81303591026,43.122770207408 -79.813037112563,43.122770401846 -79.813038314796,43.122770596249 -79.813039517099,43.122770790644 -79.813040719343,43.122771093897 -79.81304178867,43.1227712883 -79.813042990973,43.122771507314 -79.813044186771,43.12277170176 -79.813045389063,43.122771896155 -79.813046591307,43.122772193661 -79.813047801397,43.122772388099 -79.813049003631,43.12277260712 -79.813050199487,43.122772801515 -79.813051401732,43.122772995918 -79.813052604035,43.122773303885 -79.813053706912,43.122773498288 -79.813054909215,43.122774106142 -79.81305850955,43.122774398926 -79.813059686031,43.122774593372 -79.813060888323,43.122775201183 -79.813064488669,43.122775498731 -79.813065698749,43.12277589799 -79.813067996083,43.122776092393 -79.813069198386,43.122776389898 -79.813070408477,43.122776608911 -79.813071604275,43.122777192189 -79.813075211045,43.122777509557 -79.813076381151,43.122777703994 -79.813077583384,43.122778107974 -79.813079914327,43.122778400766 -79.813081090868,43.12277859516 -79.813082293113,43.122778789606 -79.813083495405,43.122779008619 -79.813084691203,43.122779203013 -79.813085893448,43.122779500519 -79.813087103539,43.122779694964 -79.813088305831,43.122779899828 -79.813089400921,43.122780094222 -79.813090603166,43.122780391727 -79.813091813256,43.122780610749 -79.813093009114,43.12278099958 -79.813095413592,43.122781292372 -79.813096590133,43.122781486766 -79.813097792378,43.122781705787 -79.813098988235,43.122781900224 -79.813100190469,43.122782208155 -79.813101293416,43.122782402593 -79.81310249565,43.122782791432 -79.813104900187,43.122783088937 -79.813106110278,43.12278330795 -79.813107306076,43.122783696746 -79.813109710625,43.12278398958 -79.813110887155,43.122784199114 -79.813112015806,43.122784612572 -79.813114413897,43.122784905355 -79.81311559038,43.122785488597 -79.813119197221,43.12278581072 -79.813120400866,43.122785990965 -79.813121502402,43.122786209977 -79.813122698201,43.122786404379 -79.813123900505,43.122786701919 -79.813125110526,43.122787309735 -79.813128710933,43.122787602518 -79.813129887415,43.122788001826 -79.813132184798,43.122788299331 -79.813133394889,43.122788907182 -79.813136995226,43.122789204686 -79.813138205317,43.12278939908 -79.813139407563,43.122789593525 -79.813140609855,43.122789901447 -79.813141712744,43.122790095892 -79.813142915037,43.122790509298 -79.813145313081,43.122790802089 -79.813146489623,43.122790996482 -79.813147691868,43.122791190927 -79.813148894161,43.122791488432 -79.813150104252,43.122791887688 -79.813152401588,43.122792106708 -79.813153597446,43.122792404204 -79.813154807479,43.122792598649 -79.813156009771,43.122792793042 -79.813157212017,43.122793085833 -79.813158388558,43.122793304845 -79.813159584358,43.122793704109 -79.813161881752,43.122794001657 -79.813163091833,43.122794390443 -79.813165496324,43.122794712566 -79.813166699969,43.122794906968 -79.813167902273,43.122795101404 -79.813169104507,43.122795409334 -79.813170207455,43.122795603771 -79.81317140969,43.122795798172 -79.813172611994,43.122795992608 -79.813173814228,43.122796309966 -79.813174984276,43.122796698803 -79.813177388815,43.122796996308 -79.813178598907,43.12279720117 -79.813179693997,43.122797395614 -79.81318089629,43.122797693118 -79.813182106382,43.12279791213 -79.813183302181,43.122798106523 -79.813184504427,43.122798404027 -79.813185714519,43.122798803291 -79.813188011914,43.122799096116 -79.813189188386,43.122799290517 -79.81319039069,43.122799509528 -79.81319158649,43.122799807032 -79.813192796582,43.122800400731 -79.813196296212,43.122800698235 -79.813197506304,43.122800892628 -79.813198708549,43.122801111648 -79.813199904408,43.122801409152 -79.8132011145,43.122801598874 -79.813202283184,43.122801793266 -79.81320348543,43.122802101239 -79.813204588367,43.122802295632 -79.813205790613,43.122802490068 -79.813206992848,43.122802812147 -79.813208196505,43.122803006591 -79.813209398798,43.122803200984 -79.813210601044,43.122803498487 -79.813211811136,43.122803703349 -79.813212906227,43.122804000853 -79.813214116319,43.122804195289 -79.813215318554,43.122804409543 -79.813216480815,43.12280470709 -79.813217690896,43.122804901491 -79.813218893201,43.122805095883 -79.813220095447,43.122805403856 -79.813221198384,43.122805598248 -79.81322240063,43.122805792692 -79.813223602923,43.122806090187 -79.813224812957,43.122806503599 -79.813227211061,43.122806796389 -79.813228387604,43.122807001251 -79.813229482695,43.122807195686 -79.81323068493,43.122807493189 -79.813231895022,43.122807906601 -79.813234293127,43.122808204104 -79.813235503219,43.12280839854 -79.813236705454,43.122808706469 -79.813237808403,43.122808900905 -79.813239010638,43.122809095305 -79.813240212943,43.122809388086 -79.813241389426,43.122809607105 -79.813242585285,43.122809801541 -79.81324378752,43.12281010947 -79.813244890469,43.122810303905 -79.813246092704,43.122810601409 -79.813247302796,43.122810990244 -79.813249707336,43.122811312323 -79.813250910994,43.122811506758 -79.813252113229,43.122811711576 -79.813253208332,43.122812004409 -79.813254384863,43.122812198801 -79.813255587109,43.122812496304 -79.813256797202,43.122812909715 -79.813259195307,43.122813193103 -79.813260304621,43.122813412079 -79.813261500491,43.122813606514 -79.813262702726,43.122813904017 -79.813263912819,43.122814098409 -79.813265115065,43.122814391241 -79.813266291597,43.122814790494 -79.813268588935,43.122815087997 -79.813269799028,43.122815307016 -79.813270994887,43.122815604519 -79.813272204979,43.122816003772 -79.813274502317,43.122816301274 -79.81327571241,43.122816690109 -79.813278116951,43.122817007509 -79.813279286989,43.122817201909 -79.813280489294,43.122817509872 -79.813281592173,43.122817704272 -79.813282794479,43.122818001775 -79.813284004572,43.122818390601 -79.813286409054,43.122818712723 -79.8132876127,43.122818892965 -79.813288714238,43.122819210372 -79.813289884335,43.122819599207 -79.813292288876,43.122819896709 -79.813293498969,43.122820091101 -79.813294701216,43.122820399073 -79.813295804154,43.122820812474 -79.813298202201,43.122821109977 -79.813299412294,43.12282130442 -79.813300614588,43.1228215972 -79.813301791073,43.122821802061 -79.813302886165,43.12282199646 -79.81330408847,43.122822293963 -79.813305298563,43.122822488397 -79.813306500799,43.122822810475 -79.813307704457,43.12282300491 -79.813308906693,43.122823312838 -79.813310009642,43.122823701672 -79.813312414183,43.122823994452 -79.813313590668,43.122824188895 -79.813314792962,43.122824510965 -79.813315996562,43.122824691258 -79.813317098148,43.122824988752 -79.813318308182,43.122825402161 -79.813320706289,43.122825699663 -79.813321916382,43.122825904524 -79.813323011474,43.122826197312 -79.813324188017,43.122826391746 -79.813325390253,43.122826689248 -79.813326600347,43.122826908258 -79.813327796147,43.12282720576 -79.813329006241,43.122827410621 -79.813330101333,43.12282760502 -79.813331303639,43.122827902522 -79.813332513732,43.122828096956 -79.813333715968,43.122828389744 -79.813334892512,43.122828594604 -79.813335987604,43.122828892106 -79.813337197697,43.122829111116 -79.813338393498,43.122829408618 -79.813339603592,43.122829603009 -79.813340805839,43.122829797451 -79.813342008134,43.122830105371 -79.813343111025,43.122830299813 -79.813344313319,43.122830592593 -79.813345489804,43.122830786992 -79.81334669211,43.122831109104 -79.813347895699,43.122831289354 -79.813348997296,43.122831611466 -79.813350200885,43.122831805865 -79.813351403191,43.122832103367 -79.813352613285,43.122832297801 -79.813353815521,43.122832502661 -79.813354910613,43.122832795449 -79.813356087157,43.122832989839 -79.813357289404,43.122833287341 -79.813358499498,43.12283350635 -79.813359695299,43.122833789703 -79.813360804684,43.122834008712 -79.813362000485,43.122834306214 -79.813363210579,43.122834500656 -79.813364412874,43.122834793435 -79.813365589359,43.122834987834 -79.813366791665,43.122835295797 -79.813367894546,43.122835490195 -79.813369096852,43.122835812307 -79.813370300441,43.122836006706 -79.813371502747,43.122836509067 -79.813373807933,43.12283680189 -79.813374984407,43.122837190679 -79.813377388961,43.12283769304 -79.813379694148,43.122837990585 -79.81338090423,43.122838209551 -79.813382100043,43.122838701493 -79.813384512432,43.122839004742 -79.813385581763,43.122839199133 -79.81338678401,43.122839496634 -79.813387994104,43.122839691075 -79.813389196399,43.122839988568 -79.813390406435,43.122840193436 -79.813391501586,43.122840490929 -79.813392711622,43.122841002725 -79.813395083968,43.122841197124 -79.813396286274,43.122841505086 -79.813397389155,43.122841699485 -79.813398591461,43.122841996986 -79.813399801555,43.122842191419 -79.813401003792,43.122842513495 -79.813402207451,43.122842693779 -79.813403308979,43.12284299128 -79.813404519073,43.122843205575 -79.813405681325,43.122843503076 -79.813406891419,43.122843707936 -79.813407986512,43.122844005437 -79.813409196606,43.122844199827 -79.813410398854,43.122844497328 -79.813411608949,43.12284469176 -79.813412811185,43.122844999688 -79.813413914136,43.122845194121 -79.813415116373,43.122845486908 -79.813416292917,43.122845809028 -79.813417496565,43.122846003417 -79.813418698813,43.122846311388 -79.813419801753,43.122846997711 -79.813423416332,43.122847290498 -79.813424592877,43.12292490524 -79.813778482048,43.123728589986 -79.817340495521,43.123819001797 -79.817730797992,43.125562096479 -79.82526180161,43.126352290224 -79.828680091806,43.126371493927 -79.828764987565,43.127407795926 -79.833244795444,43.129189298146 -79.841079299819,43.129566009762 -79.842707403722,43.128570609264 -79.843119504623,43.127118002929 -79.843724698354,43.126588898469 -79.843943683782,43.119640788552 -79.846975508053,43.116269602609 -79.848427805095,43.115463209268 -79.848823994691,43.113553793286 -79.849683312169,43.113553715867 -79.849683123551,43.111654261814 -79.841693177344,43.111654208955 -79.841692982329,43.110268846789 -79.835610897079,43.110268793917 -79.835610702076,43.109590047052 -79.832624887046,43.109589994225 -79.832624692097,43.108344757178 -79.827081207958,43.108344704287 -79.827081012972,43.107372852097 -79.822761396678,43.107372799197 -79.822761201701,43.106127695209 -79.817279292439,43.104760196603 -79.811320584182,43.106392005228 -79.810637687702,43.111636709371 -79.808422109977,43.114581813649 -79.80715971253,43.117057714176 -79.80609846923,43.117463786158 -79.805924387244,43.118438988571 -79.805514488995,43.12053000068 -79.804635487977,43.120825901794 -79.804519106556))',
4326
);
set #j = ST_GeomFromText('Point(43.6645419 -79.8133914)', 4326);
SELECT ST_Contains(#i, #j)
MySQL Online compiler
and here is the map, which shows the position of point and polygon
polygon & point position in map
I have been searching for a long time and still don't know where the problem is. Please help me to check it out. Thank you in advance.
I have tables with Geometry (Multipolygon Shape field) in Mysql. I am able to successfully run Area and Centroid. Is there a way in MySql however to query the intersection between two shapes expressed as a percentage of one in the other?
As per comment/request I am pasting in two mutlipoint geometry fields as I cannot figure out how to create a shape based table in sqlfiddle to make that easier, my apologies.
Zip Code 07024:
POLYGON((-73.982967 40.85601, -73.982439 40.856535, -73.982753 40.856696, -73.981338 40.858725, -73.98116 40.858553, -73.98071 40.858127, -73.979611 40.860178, -73.979382 40.860799, -73.978783 40.860699, -73.977687 40.8605, -73.977625 40.861338, -73.976375 40.863927, -73.975979 40.866037, -73.97581 40.86715, -73.97595 40.867368, -73.976498 40.868123, -73.975997 40.868331, -73.975852 40.868393, -73.975695 40.868462, -73.975424 40.868732, -73.975409 40.868767, -73.973501 40.867578, -73.972993 40.867361, -73.969825 40.865568, -73.969308 40.866081, -73.96889 40.866665, -73.967939 40.86767, -73.967224 40.868426, -73.966833 40.868573, -73.966599 40.868801, -73.965903 40.868417, -73.966106 40.868212, -73.965416 40.867819, -73.964641 40.867337, -73.963922 40.866921, -73.963033 40.866334, -73.961553 40.865627, -73.961057 40.865172, -73.959983 40.864747, -73.959338 40.864314, -73.958603 40.864012, -73.957929 40.863618, -73.95707 40.863094, -73.956499 40.862808, -73.955373 40.862408, -73.954582 40.861799, -73.953682 40.861199, -73.948385 40.858471, -73.951755 40.852121, -73.952044 40.851599, -73.952172 40.851368, -73.953482 40.849, -73.953982 40.848, -73.961982 40.8481, -73.96428 40.845936, -73.964416 40.846578, -73.965254 40.846613, -73.965508 40.846873, -73.965588 40.847314, -73.965493 40.847721, -73.965655 40.847583, -73.966297 40.847017, -73.967897 40.847412, -73.968466 40.84673, -73.968146 40.845991, -73.968481 40.845201, -73.969975 40.843707, -73.970303 40.843316, -73.971301 40.84213, -73.971575 40.841806, -73.972478 40.839104, -73.973107 40.835428, -73.973165 40.834416, -73.972952 40.834229, -73.972949 40.834164, -73.972968 40.834096, -73.973174 40.833617, -73.973334 40.832466, -73.973306 40.831923, -73.973267 40.831735, -73.973956 40.831892, -73.974176 40.831515, -73.974314 40.831326, -73.975646 40.828897, -73.976382 40.8276, -73.977731 40.82829, -73.978276 40.828543, -73.979977 40.829541, -73.98278 40.83107, -73.983573 40.831429, -73.983872 40.831592, -73.984742 40.832144, -73.985562 40.832688, -73.986268 40.833146, -73.986988 40.833553, -73.987719 40.83392, -73.988414 40.834306, -73.988761 40.83452, -73.989092 40.834704, -73.989874 40.835095, -73.990621 40.835377, -73.991325 40.835884, -73.991221 40.836037, -73.991102 40.836253, -73.990782 40.836634, -73.990063 40.83715, -73.988368 40.838989, -73.98773 40.839638, -73.987034 40.840345, -73.985915 40.841463, -73.984496 40.84288, -73.982203 40.84517, -73.982909 40.845573, -73.981298 40.847192, -73.981261 40.847214, -73.981144 40.847338, -73.981849 40.847781, -73.982608 40.848169, -73.98345 40.848469, -73.983527 40.848719, -73.984391 40.849063, -73.984835 40.849151, -73.984801 40.849419, -73.984896 40.850679, -73.985459 40.851398, -73.986166 40.850754, -73.98666 40.850301, -73.986718 40.850249, -73.987145 40.850414, -73.987891 40.850822, -73.987985 40.850884, -73.985961 40.853208, -73.984196 40.854911, -73.984091 40.854855, -73.98367 40.85531, -73.98354 40.85544, -73.982967 40.85601))
Fort Lee, NJ:
POLYGON((-73.985961 40.853208, -73.985344 40.853804, -73.984777 40.854344, -73.984228 40.854929, -73.983651 40.85551, -73.983092 40.856083, -73.982599 40.856605, -73.982753 40.856696, -73.981338 40.858725, -73.98116 40.858553, -73.980744 40.858154, -73.98071 40.858127, -73.980363 40.858773, -73.979611 40.860178, -73.979382 40.860799, -73.978783 40.860699, -73.977687 40.8605, -73.977625 40.861338, -73.976375 40.863927, -73.975979 40.866037, -73.97581 40.86715, -73.975695 40.868462, -73.97569 40.868903, -73.975409 40.868767, -73.973501 40.867578, -73.972993 40.867361, -73.970023 40.865686, -73.969825 40.865568, -73.969308 40.866081, -73.96889 40.866665, -73.967939 40.86767, -73.967224 40.868426, -73.966833 40.868573, -73.966106 40.868212, -73.965416 40.867819, -73.964641 40.867337, -73.963922 40.866921, -73.963033 40.866334, -73.962108 40.865929, -73.961553 40.865627, -73.961057 40.865172, -73.959983 40.864747, -73.959338 40.864314, -73.958603 40.864012, -73.957929 40.863618, -73.95707 40.863094, -73.956499 40.862808, -73.955373 40.862408, -73.954582 40.861799, -73.953682 40.861199, -73.948385 40.858471, -73.951755 40.852121, -73.952044 40.851599, -73.952172 40.851368, -73.953482 40.849, -73.953982 40.848, -73.961982 40.8481, -73.96428 40.845936, -73.964416 40.846578, -73.965212 40.846846, -73.96479 40.84776, -73.965493 40.847721, -73.965655 40.847583, -73.96588 40.847401, -73.965979 40.847321, -73.966155 40.847204, -73.966226 40.847134, -73.966286 40.847041, -73.966297 40.847017, -73.966418 40.847051, -73.966735 40.847137, -73.967225 40.847271, -73.967897 40.847412, -73.968193 40.847056, -73.968203 40.847044, -73.968466 40.84673, -73.968146 40.845991, -73.968303 40.845524, -73.968481 40.845201, -73.969975 40.843707, -73.970303 40.843316, -73.971301 40.84213, -73.971575 40.841806, -73.972478 40.839104, -73.973107 40.835428, -73.973165 40.834416, -73.973225 40.834413, -73.973289 40.834392, -73.973332 40.834364, -73.973379 40.834284, -73.973394 40.834221, -73.973391 40.834167, -73.973355 40.833909, -73.973351 40.833778, -73.973398 40.833352, -73.973433 40.833179, -73.973485 40.833009, -73.973814 40.832198, -73.973956 40.831892, -73.97406 40.831701, -73.974176 40.831515, -73.974314 40.831326, -73.975646 40.828897, -73.976382 40.8276, -73.977731 40.82829, -73.978276 40.828543, -73.979977 40.829541, -73.98278 40.83107, -73.983573 40.831429, -73.983872 40.831592, -73.984742 40.832144, -73.985562 40.832688, -73.986268 40.833146, -73.986988 40.833553, -73.987719 40.83392, -73.988414 40.834306, -73.988761 40.83452, -73.989092 40.834704, -73.989874 40.835095, -73.990621 40.835377, -73.991325 40.835884, -73.991221 40.836037, -73.991102 40.836253, -73.990782 40.836634, -73.990707 40.836688, -73.990063 40.83715, -73.988368 40.838989, -73.98773 40.839638, -73.987034 40.840345, -73.985915 40.841463, -73.984496 40.84288, -73.982203 40.84517, -73.981262 40.84611, -73.980579 40.846792, -73.980459 40.846915, -73.981144 40.847338, -73.981849 40.847781, -73.982608 40.848169, -73.98345 40.848469, -73.983527 40.848719, -73.984391 40.849063, -73.984835 40.849151, -73.985717 40.849611, -73.98625 40.850043, -73.986394 40.850027, -73.986431 40.850024, -73.986718 40.850249, -73.987145 40.850414, -73.987891 40.850822, -73.987985 40.850884, -73.985961 40.853208))
How to get Google maps kml file using link?
I tried
http://maps.google.com/maps?f=d&hl=en&saddr=-8.703893,115.223558&daddr=-8.36429800000000,115.461588000000&ie=UTF8&0&om=0&output=kml
but it returns Google maps view.
A month ago, I tried that step and got kml:
<?xml version="1.0" encoding="UTF-8"?><kml xmlns="http://earth.google.com/kml/2.2"><Document><name>R. de Viana do Castelo to R. de Sá da Bandeira</name><Style id="roadStyle"><LineStyle><color>7fcf0064</color><width>6</width></LineStyle></Style><Snippet><![CDATA[<font size=+1>Printable view</font>]]></Snippet><Placemark><name>Head west on R. de Viana do Castelo toward R. José Estêvão</name><description><![CDATA[go 100 m]]></description><address>R. de Viana do Castelo</address><StyleMap><Pair><key>normal</key><Style><IconStyle><Icon>
....
<coordinates>-8.429200,40.211490,0</coordinates></Point></Placemark><Placemark><name>Route</name><description><![CDATA[Distance: 68.4 km (about 49 mins)<br/>Map data ©2012 Google, Tele Atlas]]></description><GeometryCollection><LineString><coordinates>-8.652610,40.641880,0.000000 -8.653620,40.641430,0.000000 -8.653620,40.641430,0.000000 -8.653820,40.641410,0.000000 -8.653880,40.641330,0.000000 -8.653840,40.641210,0.000000 -8.654680,40.641170,0.000000 -8.655050,40.641110,0.000000 -8.655720,40.640970,0.000000 -8.656380,40.640710,0.000000 -8.656380,40.640710,0.000000 -8.656780,40.640690,0.000000 -8.657100,40.640770,0.000000 -8.657280,40.640880,0.000000 -8.657930,40.641600,0.000000 -8.658400,40.641700,0.000000 -8.658400,40.641700,0.000000 -8.658440,40.641880,0.000000 -8.658610,40.642040,0.000000 -8.658890,40.642130,0.000000 -8.659080,40.642110,0.000000 -8.659290,40.642010,0.000000 -8.659430,40.641810,0.000000 -8.660240,40.641170,0.000000 -8.660420,40.641090,0.000000 -8.660730,40.641050,0.000000 -8.661010,40.641120,0.000000 -8.661110,40.641190,0.000000 -8.661260,40.641460,0.000000 -8.661200,40.641700,0.000000 -8.660880,40.642040,0.000000 -8.660880,40.642040,0.000000 -8.659510,40.643000,0.000000 -8.656300,40.644980,0.000000 -8.654190,40.646160,0.000000 -8.650060,40.648260,0.000000 -8.642070,40.652910,0.000000 -8.640550,40.653600,0.000000 -8.639300,40.654000,0.000000 -8.638260,40.654190,0.000000 -8.636930,40.654290,0.000000 -8.635650,40.654240,0.000000 -8.634620,40.654070,0.000000 -8.633690,40.653840,0.000000 -8.632850,40.653560,0.000000 -8.632020,40.653220,0.000000 -8.630330,40.652430,0.000000 -8.623800,40.649200,0.000000 -8.622170,40.648520,0.000000 -8.620320,40.648110,0.000000 -8.616880,40.647970,0.000000 -8.615880,40.647870,0.000000 -8.615050,40.647720,0.000000 -8.613940,40.647380,0.000000 -8.613090,40.647000,0.000000 -8.612710,40.646780,0.000000 -8.611850,40.646210,0.000000 -8.610560,40.645240,0.000000 -8.609240,40.644340,0.000000 -8.608390,40.643850,0.000000 -8.607770,40.643550,0.000000 -8.606120,40.642920,0.000000 -8.604950,40.642600,0.000000 -8.603840,40.642380,0.000000 -8.603840,40.642380,0.000000 -8.603660,40.642290,0.000000 -8.602670,40.642100,0.000000 -8.602130,40.641850,0.000000 -8.601820,40.641570,0.000000 -8.601540,40.641210,0.000000 -8.601360,40.640540,0.000000 -8.601600,40.639540,0.000000 -8.601590,40.639420,0.000000 -8.602790,40.635880,0.000000 -8.603100,40.634520,0.000000 -8.603120,40.633080,0.000000 -8.602910,40.631890,0.000000 -8.602550,40.630820,0.000000 -8.602110,40.629940,0.000000 -8.597920,40.623920,0.000000 -8.597610,40.623510,0.000000 -8.596790,40.622590,0.000000 -8.595850,40.621770,0.000000 -8.595000,40.621150,0.000000 -8.587700,40.616500,0.000000 -8.586670,40.615680,0.000000 -8.586260,40.615250,0.000000 -8.585680,40.614570,0.000000 -8.585200,40.613840,0.000000 -8.585030,40.613470,0.000000 -8.584490,40.611960,0.000000 -8.584380,40.611110,0.000000 -8.584380,40.610600,0.000000 -8.584490,40.609750,0.000000 -8.584730,40.608800,0.000000 -8.584880,40.608400,0.000000 -8.585650,40.607160,0.000000 -8.586680,40.606020,0.000000 -8.587080,40.605690,0.000000 -8.588150,40.604890,0.000000 -8.591140,40.602800,0.000000 -8.592310,40.601840,0.000000 -8.592920,40.601260,0.000000 -8.593860,40.600170,0.000000 -8.594560,40.599070,0.000000 -8.595060,40.598040,0.000000 -8.595390,40.596960,0.000000 -8.595630,40.595950,0.000000 -8.595760,40.594720,0.000000 -8.595890,40.592520,0.000000 -8.596140,40.591310,0.000000 -8.596330,40.590740,0.000000 -8.596540,40.590200,0.000000 -8.596900,40.589490,0.000000 -8.597560,40.588370,0.000000 -8.598080,40.587670,0.000000 -8.599420,40.586120,0.000000 -8.599420,40.586120,0.000000 -8.599520,40.586120,0.000000 -8.599580,40.586070,0.000000 -8.600460,40.585230,0.000000 -8.601140,40.584700,0.000000 -8.601350,40.584460,0.000000 -8.601350,40.584460,0.000000 -8.601880,40.584390,0.000000 -8.602070,40.584270,0.000000 -8.602210,40.584050,0.000000 -8.602250,40.583760,0.000000 -8.602210,40.583490,0.000000 -8.602060,40.583290,0.000000 -8.601670,40.583050,0.000000 -8.601360,40.583010,0.000000 -8.601020,40.583070,0.000000 -8.600690,40.583290,0.000000 -8.600610,40.583440,0.000000 -8.599470,40.583540,0.000000 -8.595860,40.583160,0.000000 -8.594770,40.582930,0.000000 -8.594130,40.582880,0.000000 -8.593490,40.582880,0.000000 -8.591910,40.582740,0.000000 -8.591240,40.582790,0.000000 -8.590980,40.582770,0.000000 -8.590720,40.582710,0.000000 -8.581530,40.578690,0.000000 -8.575560,40.573340,0.000000 -8.573830,40.571620,0.000000 -8.573050,40.571140,0.000000 -8.571290,40.570160,0.000000 -8.571170,40.570040,0.000000 -8.568990,40.568900,0.000000 -8.568990,40.568900,0.000000 -8.568840,40.569050,0.000000 -8.568740,40.569060,0.000000 -8.567510,40.569970,0.000000 -8.566860,40.570220,0.000000 -8.565970,40.570350,0.000000 -8.564840,40.570380,0.000000 -8.562610,40.570550,0.000000 -8.562610,40.570550,0.000000 -8.561800,40.570500,0.000000 -8.561500,40.570420,0.000000 -8.561240,40.570300,0.000000 -8.560880,40.570000,0.000000 -8.560740,40.569810,0.000000 -8.560580,40.569310,0.000000 -8.560730,40.567730,0.000000 -8.560640,40.567420,0.000000 -8.561140,40.564610,0.000000 -8.561350,40.562640,0.000000 -8.561410,40.561610,0.000000 -8.561380,40.560610,0.000000 -8.561320,40.559590,0.000000 -8.561170,40.558400,0.000000 -8.560340,40.554600,0.000000 -8.560180,40.553680,0.000000 -8.560050,40.552730,0.000000 -8.560010,40.551320,0.000000 -8.560050,40.550820,0.000000 -8.560350,40.549540,0.000000 -8.560750,40.548360,0.000000 -8.561710,40.546010,0.000000 -8.562030,40.544540,0.000000 -8.562080,40.543690,0.000000 -8.562010,40.542690,0.000000 -8.561850,40.541920,0.000000 -8.561590,40.541130,0.000000 -8.561240,40.540350,0.000000 -8.560610,40.539330,0.000000 -8.558140,40.536150,0.000000 -8.557160,40.534710,0.000000 -8.556260,40.533160,0.000000 -8.555290,40.531070,0.000000 -8.553650,40.526410,0.000000 -8.553010,40.524900,0.000000 -8.552630,40.524110,0.000000 -8.552070,40.523170,0.000000 -8.551390,40.522100,0.000000 -8.550670,40.521140,0.000000 -8.549660,40.519940,0.000000 -8.548460,40.518720,0.000000 -8.547190,40.517600,0.000000 -8.545850,40.516570,0.000000 -8.544240,40.515460,0.000000 -8.538960,40.512550,0.000000 -8.537560,40.511610,0.000000 -8.536570,40.510830,0.000000 -8.535830,40.510170,0.000000 -8.535200,40.509510,0.000000 -8.534170,40.508310,0.000000 -8.533380,40.507120,0.000000 -8.532720,40.505930,0.000000 -8.532480,40.505450,0.000000 -8.532040,40.504310,0.000000 -8.531720,40.503070,0.000000 -8.531550,40.502060,0.000000 -8.531390,40.499820,0.000000 -8.531240,40.498570,0.000000 -8.530870,40.497070,0.000000 -8.530440,40.495910,0.000000 -8.529810,40.494730,0.000000 -8.529250,40.493860,0.000000 -8.526170,40.489980,0.000000 -8.524850,40.488010,0.000000 -8.524020,40.486480,0.000000 -8.523290,40.484900,0.000000 -8.522770,40.483510,0.000000 -8.522360,40.482170,0.000000 -8.521900,40.479990,0.000000 -8.521690,40.477840,0.000000 -8.521660,40.476350,0.000000 -8.521800,40.471980,0.000000 -8.521690,40.469830,0.000000 -8.521570,40.468930,0.000000 -8.521270,40.467340,0.000000 -8.520920,40.465960,0.000000 -8.518930,40.460140,0.000000 -8.518590,40.458970,0.000000 -8.518220,40.457390,0.000000 -8.517970,40.455950,0.000000 -8.517780,40.454030,0.000000 -8.517660,40.450520,0.000000 -8.517520,40.448400,0.000000 -8.517370,40.447370,0.000000 -8.517140,40.446310,0.000000 -8.516860,40.445370,0.000000 -8.516490,40.444400,0.000000 -8.515800,40.442920,0.000000 -8.515260,40.441970,0.000000 -8.513490,40.439700,0.000000 -8.512770,40.438940,0.000000 -8.511460,40.437700,0.000000 -8.505890,40.433130,0.000000 -8.503860,40.431310,0.000000 -8.502460,40.429850,0.000000 -8.501720,40.428990,0.000000 -8.500820,40.427820,0.000000 -8.499850,40.426410,0.000000 -8.499130,40.425190,0.000000 -8.498380,40.423750,0.000000 -8.497860,40.422540,0.000000 -8.497100,40.420290,0.000000 -8.496410,40.417970,0.000000 -8.495670,40.415830,0.000000 -8.495380,40.415110,0.000000 -8.494370,40.413030,0.000000 -8.493030,40.410550,0.000000 -8.492570,40.409590,0.000000 -8.492010,40.408130,0.000000 -8.491580,40.406380,0.000000 -8.491420,40.405400,0.000000 -8.491260,40.401690,0.000000 -8.491110,40.400190,0.000000 -8.490950,40.399280,0.000000 -8.490720,40.398380,0.000000 -8.489630,40.394960,0.000000 -8.489350,40.393830,0.000000 -8.489120,40.392570,0.000000 -8.489030,40.391700,0.000000 -8.488980,40.390090,0.000000 -8.489010,40.389270,0.000000 -8.489300,40.387140,0.000000 -8.489440,40.386430,0.000000 -8.489790,40.385230,0.000000 -8.490440,40.383500,0.000000 -8.491990,40.380010,0.000000 -8.492690,40.378090,0.000000 -8.493110,40.376720,0.000000 -8.493490,40.374440,0.000000 -8.493640,40.372620,0.000000 -8.493600,40.370510,0.000000 -8.493480,40.369260,0.000000 -8.492840,40.365420,0.000000 -8.492630,40.363820,0.000000 -8.492620,40.361800,0.000000 -8.492710,40.360830,0.000000 -8.492980,40.359360,0.000000 -8.493310,40.358150,0.000000 -8.494180,40.355460,0.000000 -8.494480,40.354350,0.000000 -8.494750,40.352930,0.000000 -8.494830,40.351640,0.000000 -8.494820,40.349200,0.000000 -8.494880,40.347720,0.000000 -8.495020,40.346800,0.000000 -8.495470,40.344590,0.000000 -8.495660,40.343320,0.000000 -8.495680,40.341170,0.000000 -8.495530,40.340030,0.000000 -8.495270,40.338820,0.000000 -8.494840,40.337510,0.000000 -8.493700,40.334390,0.000000 -8.493170,40.332700,0.000000 -8.492980,40.331690,0.000000 -8.492830,40.330320,0.000000 -8.492700,40.325980,0.000000 -8.492580,40.324730,0.000000 -8.492460,40.324040,0.000000 -8.492270,40.323140,0.000000 -8.491800,40.321540,0.000000 -8.490560,40.318420,0.000000 -8.490190,40.317290,0.000000 -8.489950,40.316290,0.000000 -8.489730,40.314630,0.000000 -8.489590,40.312340,0.000000 -8.489450,40.311200,0.000000 -8.489220,40.310070,0.000000 -8.489070,40.309550,0.000000 -8.488570,40.308240,0.000000 -8.487020,40.304700,0.000000 -8.486760,40.303970,0.000000 -8.486380,40.302480,0.000000 -8.486250,40.301650,0.000000 -8.486170,40.300000,0.000000 -8.486150,40.297740,0.000000 -8.486070,40.296790,0.000000 -8.485860,40.295530,0.000000 -8.485590,40.294470,0.000000 -8.485200,40.293350,0.000000 -8.484870,40.292620,0.000000 -8.484500,40.291910,0.000000 -8.483360,40.290110,0.000000 -8.482780,40.289400,0.000000 -8.481640,40.288270,0.000000 -8.479890,40.286730,0.000000 -8.478940,40.285620,0.000000 -8.478560,40.285020,0.000000 -8.478110,40.284160,0.000000 -8.477780,40.283230,0.000000 -8.477550,40.282080,0.000000 -8.477480,40.281440,0.000000 -8.477520,40.280690,0.000000 -8.477700,40.279720,0.000000 -8.477990,40.278780,0.000000 -8.478400,40.277880,0.000000 -8.478960,40.276940,0.000000 -8.479840,40.275700,0.000000 -8.482320,40.272630,0.000000 -8.482760,40.271860,0.000000 -8.483130,40.271060,0.000000 -8.483370,40.270280,0.000000 -8.483470,40.268720,0.000000 -8.483450,40.268100,0.000000 -8.483070,40.265790,0.000000 -8.483040,40.264570,0.000000 -8.483200,40.263490,0.000000 -8.483430,40.262520,0.000000 -8.483680,40.261790,0.000000 -8.484460,40.260330,0.000000 -8.484950,40.259630,0.000000 -8.486370,40.257880,0.000000 -8.486640,40.257500,0.000000 -8.487000,40.256850,0.000000 -8.487250,40.256320,0.000000 -8.487470,40.255690,0.000000 -8.487670,40.254660,0.000000 -8.487720,40.254270,0.000000 -8.487640,40.251370,0.000000 -8.487700,40.250030,0.000000 -8.487970,40.248080,0.000000 -8.488630,40.245020,0.000000 -8.488750,40.244160,0.000000 -8.488800,40.243090,0.000000 -8.488750,40.242210,0.000000 -8.488620,40.241310,0.000000 -8.488320,40.240040,0.000000 -8.487740,40.237970,0.000000 -8.487330,40.236160,0.000000 -8.487100,40.234690,0.000000 -8.487020,40.233730,0.000000 -8.487000,40.232160,0.000000 -8.487390,40.226040,0.000000 -8.487420,40.223610,0.000000 -8.487370,40.221080,0.000000 -8.487140,40.217210,0.000000 -8.487130,40.216140,0.000000 -8.487260,40.214350,0.000000 -8.487460,40.213100,0.000000 -8.487770,40.211800,0.000000 -8.488630,40.208800,0.000000 -8.488810,40.208000,0.000000 -8.489070,40.205950,0.000000 -8.489090,40.204880,0.000000 -8.489030,40.203850,0.000000 -8.488770,40.202080,0.000000 -8.488420,40.200530,0.000000 -8.488420,40.200530,0.000000 -8.488390,40.200090,0.000000 -8.488480,40.199810,0.000000 -8.488630,40.199630,0.000000 -8.488760,40.199560,0.000000 -8.488930,40.199510,0.000000 -8.489120,40.199520,0.000000 -8.489370,40.199620,0.000000 -8.489510,40.199800,0.000000 -8.489650,40.200040,0.000000 -8.489940,40.200830,0.000000 -8.489940,40.200830,0.000000 -8.489950,40.201110,0.000000 -8.489870,40.201300,0.000000 -8.489720,40.201420,0.000000 -8.489270,40.201540,0.000000 -8.486220,40.201150,0.000000 -8.485420,40.201110,0.000000 -8.484470,40.201120,0.000000 -8.483620,40.201200,0.000000 -8.482360,40.201430,0.000000 -8.481520,40.201640,0.000000 -8.480280,40.202090,0.000000 -8.479550,40.202440,0.000000 -8.478650,40.202980,0.000000 -8.476520,40.204790,0.000000 -8.475410,40.205540,0.000000 -8.473820,40.206320,0.000000 -8.465660,40.209900,0.000000 -8.464990,40.210240,0.000000 -8.462840,40.211740,0.000000 -8.461550,40.212560,0.000000 -8.460230,40.213190,0.000000 -8.458820,40.213680,0.000000 -8.457860,40.213920,0.000000 -8.456050,40.214200,0.000000 -8.454780,40.214260,0.000000 -8.448700,40.214310,0.000000 -8.447990,40.214370,0.000000 -8.446930,40.214560,0.000000 -8.446760,40.214530,0.000000 -8.446670,40.214470,0.000000 -8.446570,40.214170,0.000000 -8.446400,40.214010,0.000000 -8.446090,40.213930,0.000000 -8.445790,40.213940,0.000000 -8.445150,40.214120,0.000000 -8.444990,40.214330,0.000000 -8.444790,40.214430,0.000000 -8.444540,40.214520,0.000000 -8.443610,40.214730,0.000000 -8.443100,40.214800,0.000000 -8.442160,40.214660,0.000000 -8.441560,40.214730,0.000000 -8.440890,40.215050,0.000000 -8.439290,40.216040,0.000000 -8.439290,40.216040,0.000000 -8.438930,40.216190,0.000000 -8.438600,40.216240,0.000000 -8.438240,40.216180,0.000000 -8.437900,40.216020,0.000000 -8.437900,40.216020,0.000000 -8.437730,40.216060,0.000000 -8.436850,40.215460,0.000000 -8.436680,40.215220,0.000000 -8.436530,40.215130,0.000000 -8.436530,40.215130,0.000000 -8.435830,40.215500,0.000000 -8.435830,40.215500,0.000000 -8.435700,40.215440,0.000000 -8.435460,40.215210,0.000000 -8.433630,40.213300,0.000000 -8.433390,40.213220,0.000000 -8.433390,40.213220,0.000000 -8.431690,40.214100,0.000000 -8.431690,40.214100,0.000000 -8.429410,40.211580,0.000000 -8.429310,40.211500,0.000000 -8.429200,40.211490,0.000000 </coordinates></LineString></GeometryCollection><styleUrl>#roadStyle</styleUrl></Placemark></Document></kml>
But now it can't.
Looks like Google no longer supports this url-parameter.
As a workaround you could use other mapping tools like mapfab.com
After saving your map you can download it as kmz-file. (It also offers snapping polylines)
You can get KML attachment instead of map window if you click the google-map route link at https://code.google.com site. So you only need to make a test project there.
See details here