I want to resample geographical coordinates based on a specific number of values, let's say, 1663 for the following case:
-78.0599088 -11.89402416
-78.04317744 -11.88622134
-78.0267798 -11.87700462
-78.010353 -11.8692050399999
-77.9953194 -11.86129017
-77.96128788 -11.8449840599999
-77.92870572 -11.82838707
-77.89554864 -11.8117820699999
-77.86357524 -11.79488952
-77.83013412 -11.77942518
-77.7978615599999 -11.76223743
-77.765589 -11.7456140699999
-77.73216732 -11.72927727
-77.6996085599999 -11.7117892799999
-77.6673594 -11.6965884599999
-77.63510052 -11.6819618399999
-77.6045808 -11.6618759099999
-77.57262108 -11.6432262
-77.5406624399999 -11.62628883
-77.5072638 -11.6099197199999
-77.4753066 -11.5923951899999
-77.4427813199999 -11.57658786
-77.4093902399999 -11.5599159
-77.38064244 -11.5446833099999
However, the tricky part here is to keep the first and last positions, and to use open-source software tools (such as GDAL, AWK, GMT or other bash shell command line tools, that would be great).
As example I am looking for something similar to the "Equidistant points (fixed number)" option of XTools Pro: https://help.xtools.pro/pro/12.2/en/XTools_Pro_Components/Feature_conversions/Convert_Features_to_Points.htm
Here an expected output, a line of distance X from which 7 points (node or vertex) were created considering the first and last positions:

Traceback (most recent call last): File "./a.py", line 16, in <module> xy_floats = map(lambda x: (float(x[0]), float(x[1])), list(reader)) File "./a.py", line 16, in <lambda> xy_floats = map(lambda x: (float(x[0]), float(x[1])), list(reader)) ValueError: invalid literal for float(): -77.57262108 -11.6432262– Gery Jan 20 '19 at 12:35>>> with open('x.txt') as fin: ... reader=csv.reader(fin) File "<stdin>", line 2 reader=csv.reader(fin) ^ IndentationError: expected an indented block– Gery Jan 20 '19 at 12:39