<commit_before>POINTLAYER2ANGLES
=================

Ever create a bunch of fault lines on a map in ArcGIS and need to calculate their angles in order to create a rose diagram?

Ever notice how ArcGIS does not make this easy for you?

This is a little script that will take the output of exporting the attribute table of a points layer and calculate the angles for you (from the vertical).  All three of you may find this helpful.

How to use
----------

* In ArcGIS, draw a bunch of fault lines (or whatever) using a point layer.
* Add the XY coordinates to your attributes (see: http://ic.ucdavis.edu/information/AddXYCoordsArcGIS9.pdf)
* export your attributes to a TXT file.  The basic structure should look something like this:

<code><pre>
    "OBJECTID","ORIG_FID","POINT_X","POINT_Y"
    1,11,-33.336199,-23.817999
    2,11,-33.310700,-23.795400
    3,12,-33.341099,-23.825799
    4,12,-33.342799,-23.839100
    etc....
</pre></code>

* Make sure you have Ruby installed (Mac users are all set for this, Windows user: http://rubyinstaller.org/)
* Clone this repository via git:

    ```git clone git://github.com/daphonz/arcgis_pointlayer2angles.git```

* Go into the arcgis_pointlayer2angles directory and run:

    ```ruby ./pointlayer2angles.rb your-points-file.txt > your-points-file-with-angles.txt```

The file that is written is in the following format:

```ORIG_FID,POINT_X1,POINT_Y1,POINT_X2,POINT_X2,RAD,DEG```

Where the ```ORIG_FID``` is the id of the line from ArcGIS.

Configuration
-------------

It's relatively easy to subclass out the FileReader and read in different formats if you like.  You can also set the output to be pretty much whatever you want by modifying the 'puts' statement at the bottom of the file.<commit_msg>I apparently don't know how to write markdown.<commit_after>POINTLAYER2ANGLES
=================

Ever create a bunch of fault lines on a map in ArcGIS and need to calculate their angles in order to create a rose diagram?

Ever notice how ArcGIS does not make this easy for you?

This is a little script that will take the output of exporting the attribute table of a points layer and calculate the angles for you (from the vertical).  All three of you may find this helpful.

How to use
----------

* In ArcGIS, draw a bunch of fault lines (or whatever) using a point layer.
* Add the XY coordinates to your attributes (see: http://ic.ucdavis.edu/information/AddXYCoordsArcGIS9.pdf)
* export your attributes to a TXT file.  The basic structure should look something like this:

<code><pre>
    "OBJECTID","ORIG_FID","POINT_X","POINT_Y"
    1,11,-33.336199,-23.817999
    2,11,-33.310700,-23.795400
    3,12,-33.341099,-23.825799
    4,12,-33.342799,-23.839100
    etc....
</pre></code>

* Make sure you have Ruby installed (Mac users are all set for this, Windows user: http://rubyinstaller.org/)
* Clone this repository via git:

    ```git clone git://github.com/daphonz/arcgis_pointlayer2angles.git```

* Go into the arcgis_pointlayer2angles directory and run:

    ```ruby ./pointlayer2angles.rb your-points-file.txt > your-points-file-with-angles.txt```

The file that is written is in the following format:

    ```ORIG_FID,POINT_X1,POINT_Y1,POINT_X2,POINT_X2,RAD,DEG```

Where the ORIG_FID is the id of the line from ArcGIS.

Configuration
-------------

It's relatively easy to subclass out the FileReader and read in different formats if you like.  You can also set the output to be pretty much whatever you want by modifying the 'puts' statement at the bottom of the file.
{'fraction_non_alphanumeric': 0.10755731672799321, 'fraction_numerical': 0.04811774695726012, 'mean_word_length': 3.8344733242134064, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1250875', 'n_tokens_mistral': 1181, 'n_tokens_neox': 1061, 'n_words': 446}