ARYAN_GUPTA's Blog

Week 5 : Adding Functionality to the UI

ARYAN_GUPTA
Published: 07/06/2020

The first phase of coding is over, and I am really happy that I passed :)) 4 weeks back, I wasn't sure of my capabilities, but every day now feels good; like I am going to accomplish a lot! Every week has been productive, but this week, I was able to accomplish lots of features, which really made my mentors happy :)) 

What did you do this week?

Since the UI Design had been done, I spent this week adding functionalities to the buttons, removing bugs. Not sure if it would make sense without the UI, but here is what I did last week : 

  • Multiple Files can now be added simultaneously
  • Multiple Files can be displayed simultaneously
  • Extra buttons like Remove and Remove All for clearing the list
  • Double clicking on any KML file in the listWidget opens up a custom dialog box UI.
  • Bug fixing is done.
  • Single button "Add KML File" for adding & loading multiple KML Files simultaneously
  • Enhancement --> duplicate files are not loaded again.
  • Reduced Size of ListWidget; will get further removed after removing extra part of UI (colours, linewidth layout)
  • check uncheck feature to load KML layer

What is coming up next?

I am mostly done with the part, but still 2 3 important features are left and they are tough to implement : 

  • Add functionality to KML Overlay checkbox ( Disabled at the moment in UI)
  • Add functionality for customize UI for individual KML Files
  • Add functionality to Merge KML Files button

If I am able to do this, it would be a strong boost to my work, as I would be done with the main aim of my project! 
If time permits, I'll start writing tests too.

Did you get stuck anywhere?

I was on such a roll, that I wanted to finish the whole feature last week. But there is a method plot_kml, which has confounded me. Sometimes I think I understand it, but it slips out. Its crucial to the remaining features, so I have to work it out!

See you next week :))

View Blog Post

Week 4 : Working on the UI

ARYAN_GUPTA
Published: 06/29/2020

Hello there! Here's a quick update on my work this week, and then I'll hop back to it :P

What did you do this week?

I had designed a UI Dialog Box which opens on the press of a button. You could add the KML files to it, remove it , order it .. the works. However, as things go in development, the mentors suggested changes; the UI should be incorporated in the original UI. I was a bit sad, but I still made the changes. Now the UI looks good, and I admit, there wasn't much need of an extra UI element haha. (Listen to your mentors fellas!)

What is coming up next?

Some functionality is still left; Individual customization , loading multiple files and more! I will work on it, and hopefully be done with this section of my work by the end of the week!

Did you get stuck anywhere?

I am currently stuck at the Load push button. Its supposed to load all checked files, but its only loading the last checked file. Maybe its an overwrite situation, maybe something i overlooked? Stay tuned to hear more!

Update : Fixed it!

 

View Blog Post

Week 3 : Fixing Bugs and Multiple KML File UI

ARYAN_GUPTA
Published: 06/22/2020

Hello there!

I really liked working this week! The work was a bit relaxed , less stressful. I also learnt new things, and saw my code being "pushed to its limits". Read on!

What did you do this week?

I was supposed to start working on the UI for adding Multiple KML Files. The main aim of my project is to be able to display multiple KML Files on the screen simultaneously, using which users can derive important information from the maps! 

I spent my week fixing a major bug (mentioned below). I also drew up a better UI and worked on the frontend implementation. 

What is coming up next?

After Frontend, I will be dealing with the backend. It will be tough, as I'll have to deal with PyQt, and our implementation of the code. I have also created a working branch for writing tests for kmloverlaydockwidget.py file. These will take up major chunks of my time :))

Did you get stuck anywhere?

Like I said, 'supposed to'. I had made a rough draft of the UI, and was going to improve on it, when a mentor found a bug in my code while running a KML file. I saw the error and understood the issue at once. While I was working on migration, there were few snippets of code, which did not make much sense to me. And since my implementation was working without them, it felt best to 'let it be'.

My foolhardiness was accentuated by the fact that I was testing my code on 20 odd lines of KML, not taking into account every case. I was happy that my code was working, I did not check if my code was working perfectly i.e. for all cases.  My mentor supplied me with the kml file he had used and it was over 7000 lines! I realised the implications of the software on a larger scale for the first time! I sat down, and understood each line, made more changes, and finally, my code was able to run the kml file! I was ecstatic to see the plot on the map. It was beautiful!

Thankfully, my 2 PRs have been accepted, and I am working hard to finish my next WIP pull request :))

Hoping for good things for this week :)))
 

View Blog Post

Week 2 : Complete Migration to Fastkml

ARYAN_GUPTA
Published: 06/15/2020

Hello there!

The Second week was much tougher than the first. Its becoming tougher and more interesting day by day!

What did you do this week?

In Week #1, I had added Fastkml support to kml overlay. However, not all dependencies were working. I spent the week solving all the issues making sure that all KML data was being parsed and the right info was being displayed.

KML focuses on mainly 3 things :

  • Object (Document, Folder, Placemark)
  • Style
  • Geometry

and it was very tough to get them all working in sync. I ran through numerous KML Test samples to check the code, and made changes accordingly. 

What is coming up next?

Discussions with my mentors are very fruitful! After a long talk, we decided that the most suitable step next is to add the feature of "Displaying Multiple KML files" together. This is an important feature and I'm glad that its starting early, because it will take me some time to understand , and implement.This week, Ill work on the UI and working with PyQt  for the above implementation. I also have to write tests for kmloverlay file, and make the implementation more code-elegant.

Did you get stuck anywhere?

Yes! Currently, we use iterative and recursive functions to parse through KML files. However, Fastkml creates objects to call function for deriving specific information. This week's work involved a lot of documentation, experimentation, frustration , but due to consistent work and patience, I got the code working perfectly!

Hoping for good things for this week :)))

View Blog Post

Week 1 : Adding Fastkml Support

ARYAN_GUPTA
Published: 06/07/2020

Hello there! 

I have finished with my first week of coding, and it was quite intensive! This week was an icebreaker, started a bit rough, but now it feels much smoother.

What did you do this week? 

As proposed by the mentors, I had to shift the codebase from using lxml API for kml, and shift it to a much more convenient Fastkml. I have completed the major part of it i.e. the parsing, and I am working on the display portion. Also, I did a Bandit run on Fastkml, which threw up 6 Security Issues, and I was able to solve 4 of it. The other 2 require switching the whole fastkml library from lxml dependency to defusedxml, and required functions were not available in that library.

What is coming up next? 

My plan for the next two weeks involve adding External Map Images as well support for Screen / Photo Overlay. I will also be working on the new tests required due to the shift in libraries, and finishing up with the Fastkml Support.

Did you get stuck anywhere?

Yes. I had to deal with 3 libraries ( lxml, defusexml,fastkml), all inter dependent on each other, which was a sure hassle. Another roadblock was while using Fastkml instead of lxml in the codebase. The lxml API returns an object which can be used to call functions, while fastkml doesn't, which led to a total transformation of ```kmloverlay_dockwidget.py``` file. But, I was able to get through it, by giving the code enough time and thought.

Needless to say, I have learnt a lot, and looking forward to the next week!

View Blog Post