Showing posts with label water. Show all posts
Showing posts with label water. Show all posts

Monday, March 4, 2024

Screen Scraping GIS Tax Ditch Lines Substandard

Better to get the GIS data someone else has already digitized than to try to digitize from a screenshot. That is what I tried a few months back before I found better source data recently delineating where stormwater drainage goes.

The idea that ditches are taxable, or tax exempt, is still mysterious to me, but we have them in Maryland.

https://geodata.md.gov/imap/rest/services/Agriculture/MD_NutrientManagementSetbacksFromWaterways/MapServer/5

"Description: This is a 35 foot buffer area along PDA ditches where fertilizer applications are restricted on croplands."

A PDA is a "Public Ditch Association." Essentially we've already done the environmental damage cutting down the forests and then terraforming the soil for industrial crop harvests. The ditches stretch for miles in some Eastern Shore counties. Taxes pay for the maintenance, as roadside ditches will fill in with dirt and trash otherwise. 

Initially I found maps showing the ditches, and the surrounding service area, as online maps.



And a map of fire coverage.


One good starting point for "ditches" is https://data.imap.maryland.gov/search?collection=dataset&q=ditch. I followed QGis tutorial lessons [https://docs.qgis.org/3.34/en/docs/training_manual/forestry/stands_digitizing.html], digitizing the above into 2 layers, one for the boundaries and one for the lines. Not very good resolution when you zoom in.






I found, after searching with different criteria, similar tax ditch geo-data in the Maryland State site, and the Eastern Shore collective site. So instead of trying to redo the digitizing effort I could skip that part. 

When I downloaded the shape files, they looked good. But when I tried to pull them into a PostgreSQL database, the points flew somewhere else. I am unsure what was missed. I made a second attempt by downloading a KML file instead of a set of shape files. These lines and areas worked, after a fashion. My PostGIS skills are still pretty fresh, like only this year did I run a local database. 


I experimented with arrows for directions, as this helps visualize the land slope, even if miniscule. There is a great example here: https://docs.qgis.org/3.34/en/docs/training_manual/vector_analysis/network_analysis.html. The "loop" above is an oddity from the ditch crossing the highway intersection. Changing the scale and map view sometimes triggers taffy-pull looking connection lines.

This page has more about rules: https://plugins.qgis.org/planet/tag/thematics/.

Next step for me is altering the labels so that roads are distinct from ditches, because there is both a Chicken Bridge Road and a Chicken Bridge drainage area/network. 


Tuesday, February 20, 2024

Well Sample Data and GIS Development

 I looked at water quality tests for a few private wells in Maryland to be able to better use GIS tools. After reviewing public information I took note of key fields such as well depth. In order to show connections among the various aspects I started an entity relationship diagram, going from basic SQL to end up with 8 tables.


In order to keep consistent a few constraints were included, such as:


ALTER TABLE

  well

ADD CONSTRAINT

  well_fkey_property

FOREIGN KEY

  (property_fk)

REFERENCES

  property(name)

;


  I decided to connect wells to a property, and buildings likewise. Normally one well is allowed per property, though while a replacement is being drilled one property might have 2 wells, and if a well runs dry you might say the property has no well.

 The old forms (pre-2000?) have Maryland grid coordinates, with accuracy to 1,000 feet, while the newer forms have a place for latitude/longitude. Water quality tests done by commercial lab contain values of constituents ranging from coliform bacteria to lead and arsenic.

 Sometimes the applications have typos.




Oops, mixed up east and north. I did the same when I first tried to load point data into GIS; once I noticed the drift and switched the values the wellhead came online where it should be.

 After the table definitions and test data load I used the QGis example tutorials to include the bits required for my hand-curated data to be mapped correctly.

See: 
https://docs.qgis.org/3.28/en/docs/training_manual/spatial_databases/simple_feature_model.html
https://docs.qgis.org/3.28/en/docs/training_manual/spatial_databases/geometry.html

> insert into geometry_columns values ('','public','well','the_geometry',2,4326,'POINT');

> update well set the_geometry = 'SRID=4326;POINT(-75.882996 38.938629)' where name = 'CO-15-0020' ;

 






An 8-way join, or is 7-way?

select
  r.value ,                             -- value
  r.uom,                                -- units
  p.name as name_p,                     -- param
  substr(r.name,1,12) as name_r,        -- result
  s.well_fk as well,                    -- well
  s.name as name_s,                     -- sample
  substr(s.sample_place,1,4) as place,  --
  substr(p.descr,1,10) as param_desc,   --
  substr(c.name,1,8) as name_c,         -- corp
  w.depth,                              -- well
  w.pump_installed as pump,             -- well
  substr(o.lot,1,10) as lot,            -- prop
  e.name as person,                     -- people
  s.sample_date
from
  people e,
  building b,
  lab_corp c,
  lab_sample s,
  lab_sample_results r,
  parameter p,
  property o,
  well w
where
  e.building_fk = b.name     -- people in building
and
  b.property_fk = o.name     -- building on property
and
  s.well_fk = w.name         -- sample from well
and
  w.property_fk = o.name     -- well on property
and
  r.parameter_fk = p.name
and
  r.lab_sample_fk = s.name
and
  s.lab_corp_fk = c.name
;


What have I accomplished? Now I have environmental data in a reachable database, which I can edit via command line, or even using LibreOffice forms, and now view and update via QGis.
Next I will figure out the step up from points data (the well heads) to polygons (property lines and building walls). Then, with sample data, set up views with contaminant levels on the map.



Looks a lot like dBASE IV, right? 

Saturday, September 4, 2010

A large bottle of water, please, very, very large.

We drink "city water" at our house, the kind the comes from the tap, and is collected, prepared, stored and delivered by the City of Baltimore. Years ago as a junior high student, or maybe elementary school age, I toured the Montebello Filtration Plant in northeast Baltimore, one of 2 water supply operations run by the municipal government. There, supplies from one of 2 reservoirs, or in times of extreme drought, river water from the Susquehanna some 50 miles away, is treated. The growing population, and shrinking "woods" around the reservoirs, adds to the risk of contaminants, as does the aging infrastructure.

I'm happy with the water quality, drinking it from the faucet, cooking and cleaning with it on a daily basis. When I get the water bill, I just pay it. At times, literature comes with the bill, either news the government wants to pass on, or this quarter, news that must pass on. Before that, here's a tangential web page showing our water consumption, if not the cost:

http://www.editgrid.com/user/jspath55/SPATH-HOME-WATER-USE

It's about a year out of date as I write this, but since I have the recent bills in a folder, I'll get it updated shortly. I hope.

Anyway, the 1-page insert talked about the fact that the city was being required to make improvements by the federal government (the EPA, where I once worked), and the state was involved as well (MDE; I worked there too). I had to re-read it to understand the background. EPA wants the city to cover the "finished" water reservoirs, for health and safety reasons. Sounds reasonable, until one thinks about the domed stadiums that were trendy for a few decades, starting I think with the Houston Astrodome in the mid-1960s. On another tangent, Google is celebrating the 25th anniversary of "Bucky Balls", one of the inventions of Buckminster Fuller, the man behind the geodesic dome.

The finished water is just one of the storage phases between the uncovered reservoirs and the covered conduits that deliver the liquid over hundreds of miles to homes and businesses. I recall flocculation and settling tanks, under roof, from my tour decades ago, and have seen new structures spring up as the technology and population have changed. We drove around Lake Montebello many times, and Druid Lake on the west side of the city is a landmark near the zoo. Those are uncovered, but I'm not sure if they're the target of this latest regulation. Five locations are listed as needing new covers, with Ashburton, Guilford and Towson the others beside the 2 sites I mentioned.

Searching online, with the keywords "EPA maintains that the city failed to comply with LT2", I found 2 hits, one on a Baltimore City site, and one for Anne Arundel County (with the latter including a PDF file with a scanned image of the letter for some reason).


What caught my eye, probably, was the suggestion that nothing is wrong, but that one part of the government disagrees with another part, or parts. The EPA says the city missed a deadline. The city says that the state order to them was tardy. It sounds like the penalty for missing the deadline is that the public notice needed to be mailed out.

I particularly liked that the notice included a sentence starting with "Please share this information with all the other people who drink this water...". So I am!

Geocoding note. Of the 5 lakes or reservoirs listed, I found Panoramio photos nearly only 3 of them. Sounds like a hike plan to get shots of the other 2. Here they are, if you want to armchair travel to them:

  1. Lake Montebello
  2. Druid Hill Lake
  3. Lake Ashburton - 39 19 14.63 N 76 40 12.02 W
  4. Guilford Reservoir
  5. Towson Reservoir - 39 23 35.67 N 76 35 27.40 W
For the missing two, copy and paste the latitude/longitude pair into maps.google.com.