Wednesday, December 17, 2014

Trying to find cliffs from point grid

The ask is simple: you are given vertices on a regular grid and need to return cliffs: lines where steepness gets larger than some given constant.
I tried algorithm like this:

  • mark all cells for which the borders are steep, 
  • connect 2 steepest sides with cliff segment
  • join segments where possible
End result is best described by this picture:
The small white lines are my calculated cliffs. The background is OCAD 11 generated steepness where black is 45degree steepness. My lines are calculated in a smaller subregion than the whole picture. 

This algorithm does not work without some additional improvements. Something better is needed.

Sunday, December 7, 2014

From Python to .OCD files

I have been experimenting with the OCAD libary from Open Orienteering Mapper and have written a small wrapper for it.
The wrapper is available here.
What can you do with it?
You can import symbols and polygons automagically from python into OCD files for OCAD.
Here is an example:
h_writer=CreateOcadWriter(c_double(1),c_double(1), c_double(10000))

col=AddColor(h_writer, c_char_p("some color"))
sym1=AddAreaSymbol(h_writer,c_char_p("symone"), 4100, col)
sym2=AddAreaSymbol(h_writer,c_char_p("symtwo"), 4010, col)

TYPE=(POINT*3)
t=TYPE()
array=((10,100),(100,10),(100,100))
for i in range(len(array)):
    t[i].x=array[i][0]
    t[i].y=array[i][1]

re = ExportArea(h_writer, t, 3, 4010)

WriteOcadFile(h_writer, c_char_p("c:\\projekti\\WriteODLL\\a.ocd"))
CleanWriter(h_writer)

What does this do?
  1. Creates a 1:10000 map with offset of (1,1)
  2. Create a color
  3. Creates 2 symbols (4100 is 410.0 and 4010 is 401.0)
  4. Creates a triangle of 401.0 symbol. 
  5. Writes to OCAD file.
The color is not a real color and the symbols are neither. To use this one would have to _import_ the OCD file into one which has real symbols. 
Why is this useful? If you want to experiment with larger data sets and visualize them in OCAD file, you need to automate it.

Saturday, November 29, 2014

Houghton Turkey Sprint: new map!

Today was an excellent day for O'. Snow covered the Houghton landfill and HBOC held a post Turkey Sprint race. No snow fell on us, but it was cold.

Volunteers: Ing and Will (checkpoints), Gunta (kids), Girts (drinks), Rick and Zarina (food).
Courses: Peteris
RG: Jan

Here is the new map. Ask me for PDF/OCAD version.

You can see splits.
Or you can see route gadget.

Sunday, November 2, 2014

Maps and georeferencing

For a while I have been suggesting that maps geo-referenced should have UTM projection and WGS84 datum. Now I have additional data available: NAD83 should be the datum of choice, with the reason being that LASTOOLS do not approve of WGS84, but they do recognize NAD83...

Monday, March 31, 2014

Maps & courses

Some maps for everyone to enjoy. And print out if you think you need that. 200 dpi, 1:10000. 





Sunday, March 30, 2014

Gunta's namesday two days results published / race report

The Wild horses/Frenchman coulee Gunta's namesday event has successfully finished.
These are the results:

Route gadget (non Java!!), here:
Please enter your courses!!

Maps and courses, here:
http://homebrewoc.blogspot.com/2014/03/maps-courses.html

Volunteers:
children watching: Gunta and Tori
rental esticks: Jan, Don, Eileen
control pickup: John, Eric, Girts, Ben, Don
choir: everyone at dinner table
photos and general help all over the place: Atis
RG (and no more Java!!): Jan 

Short report:
Overall success with good weather and al-right courses. The only surprise was the environmental lady to whose concern we quickly reacted and steered the courses away from the most vulnerable part of the map by some midnight updates to the printouts. The second day courses decreased in length by 1.2 km because of that. We might have not done it either - I don't think anything would have changed. 
The choir by the dinner table was most impressive. 
The photos are scattered through the facebook, but I am trying to upload a big set of them into flickr - it is taking lots of time somehow. 
We had 32 measured starts on day 2 and 26 on day 1. 

Map updates: there were some small issues with the map. If you have some time to do updates, I could share you the map. Please let me know and also the OCAD version you can work with. 

Improvements for the next time: 
1) I will probably ask someone to do at least one of the two days. 
2) I need to organize the emailings better - I have started a facebook group for homebrew OC, but not sure where it will go, please join if you want to - that will probably be a warranty I will not miss you in the next emailings, probably some time in the fall. 
3) for the races - I will probably use some eventbrite registration utility next time.