TomSchimansky / TkinterMapView

A python Tkinter widget to display tile based maps like OpenStreetMap or Google Satellite Images.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

set_path function adding lines to lat_lon list

jnordberg1 opened this issue · comments

Hi Tom, loving the map widget but I think I may have found a bug. When I pass a list of lat lon points that are created from the .get_coordinates() functionality in geopandas after reading a postgis table into a geodataframe the set_path function is displaying many more lines than what would be expected. Here is the list of lat lons being passed to the set_path function:

[(42.28615361965615, -76.7027830617343), (42.28608057578423, -76.70299148571004), (42.28608057578423, -76.70299148571004), (42.28878630196363, -76.7077291628014), (42.28878630196363, -76.7077291628014), (42.28969755661241, -76.7092796490929), (42.28969755661241, -76.7092796490929), (42.28964015960856, -76.7095234160725), (42.28964015960856, -76.7095234160725), (42.29040494842668, -76.71089803395972), (42.29040494842668, -76.71089803395972), (42.29061362295344, -76.71091088928173), (42.29061362295344, -76.71091088928173), (42.29150121750605, -76.71241955198472), (42.29150121750605, -76.71241955198472), (42.29252776776999, -76.7139960940361), (42.29252776776999, -76.7139960940361), (42.29299186906955, -76.71457981356572), (42.29299186906955, -76.71457981356572), (42.29347421316832, -76.71487841467255), (42.29347421316832, -76.71487841467255), (42.29345242313341, -76.71545677508034), (42.29345242313341, -76.71545677508034), (42.29393449180168, -76.71559512597054), (42.30523704515358, -76.71902752546396), (42.30683590327389, -76.72062019995295), (42.30683590327389, -76.72062019995295), (42.30749103094661, -76.7208678028981), (42.30749103094661, -76.7208678028981), (42.30944211637492, -76.72097996739534), (42.30944211637492, -76.72097996739534), (42.31166738238655, -76.72293757876075), (42.31166738238655, -76.72293757876075), (42.31313642199888, -76.72423423298218), (42.31313642199888, -76.72423423298218), (42.31365137551051, -76.72434115348851), (42.29393449180168, -76.71559512597054), (42.29434822240659, -76.71534790986351), (42.29434822240659, -76.71534790986351), (42.29521394779626, -76.71590675423121), (42.29521394779626, -76.71590675423121), (42.29678911305938, -76.71628664314589), (42.29678911305938, -76.71628664314589), (42.29728838908824, -76.71615316901621), (42.29728838908824, -76.71615316901621), (42.29969267159473, -76.71682164326003), (42.29969267159473, -76.71682164326003), (42.30035640869384, -76.71697906105041), (42.30035640869384, -76.71697906105041), (42.30443384935289, -76.71863293540389), (42.30443384935289, -76.71863293540389), (42.30523704515358, -76.71902752546396), (42.31365137551051, -76.72434115348851), (42.31336227548928, -76.72472849666867), (42.31336227548928, -76.72472849666867), (42.31328204349364, -76.72963135594699), (42.28608057578423, -76.70299148571004), (42.28518545435893, -76.70146427341021), (42.28518545435893, -76.70146427341021), (42.28484422118341, -76.70122713079611), (42.28484422118341, -76.70122713079611), (42.28409492143987, -76.70003198500828), (42.28409492143987, -76.70003198500828), (42.28386300749067, -76.6992900980708), (42.28386300749067, -76.6992900980708), (42.28335902273533, -76.69849827509698), (42.28335902273533, -76.69849827509698), (42.28203436160442, -76.69728446518204), (42.28203436160442, -76.69728446518204), (42.2817377767354, -76.69698873047017), (42.2817377767354, -76.69698873047017), (42.28035129478938, -76.69535833576022), (42.28035129478938, -76.69535833576022), (42.27936049590758, -76.6940021325068)]

Attached is a screenshot of the geodataframe plotted from geopandas and a screenshot of what the set_path function produces.
geopandas_plot

set_path example

If more information is needed for this question let me know, looking forward to getting this figured out.

Thanks,

Jacob

commented

Hey Jacob,

I took a quick look at your data and plotted using FME. It appears that your co-ordinates are out of order for the line. For example - The first position (index 0) is about a 1/4 of the way down the line when plotted, the most south point is index 55 (should be index 73 - the last in order). This is what is creating the line the way it is presented as it is following the point order.