Open AutoCAD and find the layer where the data is:
Type "MAPEXPORT", select "shp" file and path. In "Object Type" set the type of the features, in "Filter selection / Layers" find the layer previously found. And click "OK"
with_variable('line', overlay_nearest('axe', $geometry, limit:=1)[0],
with_variable('from_start',
round(line_locate_point(@line, $geometry),4),
@from\_start
)
)
import geopandas
from shapely.geometry import LineString, Point
def snap_along_linestring(linestring: LineString, points: [Point]):
new_points = []
for point in points:
new_points.append(linestring.interpolate(linestring.project(point)))
return new_points dist = []
lines = geopandas.read_file(r'<PATH_OF_YOUR_AXE.shp>')
points = geopandas.read_file(r'<PATH_OF_YOUR_LANDMARKS.shp>')
points['Chainage'] = None
for idL, line in lines.iterrows():
for idP, point in points.iterrows():
points.chainage[idP] = round(line.geometry.project(point.geometry),3)
points.to_file(r'<PATH_OF_YOUR_OUTPUT.shp>')
Download the binary shp2pgsql here and extract it.
./shp2pgsql -a -k -s 4326 -g Geography '<PATH\_OF\_LANDMARK.shp>' public.Landmark > landmark.sql
Open the file generated and rename all Geography by "Geography". if the import don't work try on not reprojected file:
./shp2pgsql -a -k -s <EPSG\_OF\_FILE>:4326 -g Geography '<PATH\_OF\_LANDMARK.shp>' public.Landmark > landmark.sql