How to put shapefiles together in Arcmap? - gis

I am trying to draw the boundaries of my map and I am trying to put all my shapefiles in one attribute table. This is the situation, I want to merge phragmites (meadows) L and phragmites (meadows) H. phragmites (meadows) H has 8 and phragmites (meadows) L has 39 but I tried to use the merge function the output is only 10.
I tried to use the merge function but it automatically merges is by the FID, I just don't want it to merge but I want it to be together I want my new attribute table to have 47 rows combining both the H and L phragmites.

Related

Joining a .csv and a vector layer in QGIS

I have a couple of layers that I need to join in QGIS. One of them is a vector one and contains the information about the geometry (a series of polygons, each one characterized by a certain id). On the other side I have a .csv file in which there is information about these polygons, but it is not a single data per polygon, here my problem with the joins. It is a temporal dataset file in which a field appears with a value assigned for each date and polygon (not continuously, but almost).
An example of the .csv file would be:
id
polygon
date
cost
1
A1
01-01
100
2
A2
01-01
500
...
...
...
...
100
A1
02-01
250
101
A2
02-01
360
102
A3
02-01
150
The idea of joining both files is to be able to make each polygon to be painted (with the help of the "temporal" tool) depending on whether it exceeds a certain value of the cost field.
I have tried to make a relation from "project" but I could only access the form.
Thank you very much!
Follow solutions works for me.
Add Delimited Text with right data types (our csv).
Vector general -> join attribute by field value. Choose the Join type "Create separate features for each matching feature.

reverse tail for gnuplot

I would like to display data in a repeated online diagram with:
plot "tail -140 logging.dat | tac -r" with lines
I get an error message file cannot be opened, however in CLI it gives the reverse list of data as expected. Could anyone help me with the correct syntax, please?
Just for the records, here is a gnuplot-only, hence platform-independent solution. Check via stats the total number of lines. If there are less than N lines (here: 140), all lines will be plotted, otherwise only the 140 last ones.
Remark: if you do plot ... with lines, gnuplot will plot column 1 as x and column 2 as y per default. However, the output graph will look the same whether you reverse the data or not. So, I don't see why reversing the data would be necessary, unless you want to plot something what you haven't shown here or e.g. list a reversed table as text.
Script:
### plot N last lines of a file
reset session
FILE = "SO55221113.dat"
# create some random test data
set table FILE
set samples 1000
y0 = rand(0)
plot '+' u 1:(y0=y0+rand(0)-0.5)
unset table
N = 140
stats FILE u 0 nooutput # get total number of lines into STATS_records
M = STATS_records<=N ? STATS_records : STATS_records-N
plot FILE u 1:2 w l lc rgb "green" ti "all values", \
'' u 1:2 every ::M w l lc rgb "red" ti sprintf("last %d values",N)
### end of script
Result:

Efficiently finding the intersections of an array of lines

I am finding the intersection of an array of lines via determinants. However, to look for all intersections, I am checking each line with every other line, creating O(n^2) checks.
Is there a more efficient way to check for all of the intersections? I'm afraid of the run time when I am trying to sort out the intersections between hundreds or thousands of lines.
Please specify - do you mean infinite lines?
For line segments there is efficient Bentley-Ottmann algorithm.
For N infinite lines there are about N^2 intersections (if most of them are not parallel), so your approach is optimal in complexity sense (perhaps, micro-optimization is possible)
Edit: with clarified task description Bentley-Ottmann looks like overhead.
Find intersections of lines with clipping window
(for example, using Liang-Barsky algorithm)
Consider only lines that intersect window
Scan top window border from left corner to the right
Insert every line end into the binary search tree
(and add link to this tree node from the paired end to the map)
Scan right window border from top corner to the bottom right one
Check whether current line already has another end in the tree/map
If yes
all lines with ends between positions of the first and
the second ends do intersect with it
Calculate intersections and remove both line ends from tree and map
else
Insert line end into the list
Continue for bottom and left edge.
Complexity O(N) for preliminary treatment and O(K + MlogM) for M lines intersecting window rectangle and K intersection (note that K might be about N^2)
Example: tree state for walking around the perimeter
E //and map F to E node
EG //and map H to G
EGI
EGIK
EGIK + H
H has pair point G, so GH intersect IJ and KL
remove G
EIK
EIK + F
F has pair point E, so EH intersect IJ and KL
remove E
IK
IK + J
J has pair point I, so IJ intersect KL
remove I
K
K+L
remove K
end (5 intersections detected)

Importing Nodes with Coordinates to Gephi from CSV

This question seems pretty stupid but I actually fail to find a simple solution to this. I have a csv file that is structured like this:
0 21 34.00 34.00
1 23 35.00 25.00
2 25 45.00 65.00
The first column is the node's id, the second is an unimportant attribute. The 3rd and 4th attribute are supposed to be the x and y position of the nodes.
I can import the file into the Data Laboratory without problems, but I fail to explain to Gephi to use the x y attributes as the corresponding properties. All I want to achieve is that Gephi sets the x Property to the value of the x Attribute (and y respectively). Also see picture.
Thanks for your help!
In the Layout window, you can select "Geo Layout" and define which columns are used as Latitude and Longitude.
The projection might come in weird if you do not actually have GeoData, but for me, this is fine.
In Gephi 0.8 there was a plugin called Recast column. This plugin is unfortunately not ported to Gephi 0.9 yet, but it allowed you to set Standard (hidden) Columns in the Node Table, from visible values in the nodes table. Thus if you have two columns of type Float or Decimal that represent your coordinates, you could set the coordinate values of your nodes.

Adding subtrees to a tree

Suppose I have a tree X
a
b c
d e f g
and I want to add a long subtree Y to X
a
b
e
u
so X+Y would look like this.
a
b c
d e f g
u
How would one go about implementing such a tree concatenation?
What you're describing sounds to me like you're trying to insert a word into a trie. If that's what you're trying to do, you can start at the root of the trie and the beginning of the word and then process each character x - if there is no edge labeled x from the current node, create a new node and add an edge between them; then, in either case, follow the edge labeled x and move to the next character.