leebuhrmann / loGIStics

Computer Science Major Capstone Project (CSCI4970). SNOW allows users to create geospatial boundaries on a map view and receive relevant weather notifications about alerts within those boundaries.
1 stars 1 forks source link

Issue 52 #55

Closed leebuhrmann closed 7 months ago

leebuhrmann commented 7 months ago

The goal of Issue-52 is to create a UGC Zone scraper that collects all relevant UGC Zones for a given alert and adds them to the database with their geospatial data. It checks to make sure the UGC zone does not already persist in the database before scraping to avoid unneeded API calls. Three major sections had to be completed to implement this.

  1. Create the Model, Repo, and Service classes for UGC Zones.

  2. Create POJOs that aid with deserializing the UGC Zone API calls into useable objects.

  3. Create the UgcZoneScraper that utilizes both of the above points.

  4. Create the Model, Repo, and Service classes for UGC Zones.

This is straight forward and is implemented in a manner similar to Boundary data. Currently is unable to store geospatial data.

  1. Create POJOs that aid with deserializing the UGC Zone API calls into useable objects.

I had to create a parent Geometry.java class and its children classes Polygon/java and MultiPolyon.java. This is because depending on the type of alert the geometry retrieved will be either a 3 dimension list or a 4 dimension list. Make sure you check the type of a UgcZoneResponse before grabbing its coordinates.

  1. Create the UgcZoneScraper that utilizes both of the above points.

This part is implemented similarly to the NWSDataService class. It makes the GET API call and maps the GeoJson to a UgcZoneResponse. Afterward it uses the UgcZoneService class to push it onto the database.