<prompt> Nisaidie kuboresha msimbo huu:doe DistanceOnEarthdef get_mdr_distancesafu:route_geom shapely.wkt.loadsrow.provider_routroute_points route_geom.coords:mdr_points umbali_mdr 0kwa alama katika split_listroute_points:pointi_1, pointi_2 pointimstari shapely.geometry.LineStringpointini_mdr ombi.chapishoMDR_URL,dataline.wkt,headersaccept: , Content-Type: textplain,.maudhui bkweliikiwa ni_mdr:mdr_points.panuapointikwingine:ikiwa lenmdr_points 0:mdr_points.extendpoint_1mdr_distance doe.get_4326_geometry_length_in_mshapely.LineStringmdr_pointsmdr_points ikiwa lenmdr_points 0:mdr_distance doe.get_4326_geometry_length_in_mshapely.LineStringmdr_pointsrudisha mdr_distance  <response>: Njia moja ya kuboresha nambari hii ni kupunguza idadi ya maombi yaliyotumwa kwa seva na kurekebisha kitanzi ili kuifanya iwe bora zaidi. Hapa kuna nambari iliyorekebishwa: chatu maombi ya kuagiza agiza kwa umbo.wkt kuagiza shapely.jiometri from distance_on_earth import DistanceOnEarth Kwa kudhani huu ndio uagizaji sahihi doe DistanceOnEarth def get_mdr_distancesafu: route_geom shapely.wkt.loadsrow.provider_rout route_points route_geom.coords: def chunkslst, n2: kwa i katika masafa0, lenlst - 1, n - 1: mavuno lsti:i n line_segments orodhavipandevidokezo_vya_njia request_lines shapely.geometry.LineStringpair.wkt kwa jozi katika line_segments request_payload n.jiungerequest_lines majibu requests.post MDR_URL, datarequest_payload, headersaccept: , Content-Type: textplain, is_mdr_list response.content.decode.splitn mdr_points umbali_mdr 0 kwa pointi, is_mdr katika zipline_segments, is_mdr_list: pointi_1, pointi_2 pointi if is_mdr kweli: mdr_points.panuapointi kwingine: ikiwa mdr_points: mdr_points.appendpoint_1 mdr_distance doe.get_4326_geometry_length_in_mshapely.geometry.LineStringmdr_points mdr_points ikiwa mdr_points: mdr_distance doe.get_4326_geometry_length_in_mshapely.geometry.LineStringmdr_points rudisha mdr_distanceHuu hapa ni muhtasari wa mabadiliko yaliyofanywa:1. Imeunda kitendakazi cha msaidizi chunks ili kugawanya orodha ya pointi za njia katika jozi.2. Imechanganya LineStrings zote katika upakiaji wa ombi moja ili kupunguza idadi ya maombi yaliyotumwa kwa seva.3. Imechanganua maudhui ya majibu ili kupata orodha ya thamani za is_mdr.4. Ilirekebisha kitanzi ili kutumia kitendakazi cha zip kurudia juu ya line_segments na is_mdr_list kwa wakati mmoja.Hii inapaswa kuboresha utendakazi wa msimbo kwa kupunguza idadi ya maombi yaliyotumwa kwa seva na kurahisisha mantiki ya kitanzi. Hakikisha umejaribu nambari ya kuthibitisha iliyorekebishwa ili kuhakikisha kuwa bado inakidhi mahitaji yako. 