Fundamentals 30 min read

Map Trajectory Technology: Fundamentals, Data Formats, GIS Operations, and Path Planning

This article provides a comprehensive overview of map trajectory technology, covering GIS fundamentals, coordinate systems, data formats, import/export methods, GPS processing, spatial analysis, path‑planning algorithms, real‑time and historical tracking, and recent advances such as AI‑driven services and high‑precision mapping.

JD Tech Talk
JD Tech Talk
JD Tech Talk
Map Trajectory Technology: Fundamentals, Data Formats, GIS Operations, and Path Planning

1. Fundamentals of GIS

(1) Geographic Coordinate Systems

WGS84 is the global standard used by GPS to define latitude and longitude, while UTM divides the earth into 60 projected zones for precise planar calculations, often used in urban planning.

(2) Map Projections and Coordinate Transformations

Common projections include Gauss‑Krüger for regional maps and Mercator for marine navigation; coordinate transformations bridge different systems (e.g., WGS84 to local planar coordinates).

(3) Basic GIS Software Operations

ArcGIS offers a comprehensive suite of spatial analysis tools but requires a license, whereas QGIS is free, extensible, and supports Python plugins for advanced tasks.

from qgis.core import QgsApplication, QgsProject
# Initialize QGIS application
qgs = QgsApplication([], False)
qgs.initQgis()
project = QgsProject.instance()
project.read('example.qgs')
for layer in project.mapLayers().values():
    print(f"Layer name: {layer.name()}")
    print(f"Layer type: {'Vector' if layer.type() == 0 else 'Raster'}")
    if layer.type() == 0:
        print(f"Feature count: {layer.featureCount()}")
        print(f"Geometry type: {layer.geometryType()}")
        fields = layer.fields()
        field_names = [field.name() for field in fields]
        print(f"Field names: {', '.join(field_names)}")
    print("-" * 50)
qgs.exitQgis()

2. Map Data Formats and Processing

(1) Common Vector Formats

Shapefile (multiple files: .shp, .shx, .dbf), GeoJSON (JSON‑based, web‑friendly), KML (XML‑based, used by Google Earth).

(2) Common Raster Formats

TIFF (high‑quality, supports georeferencing), JPEG (lossy, lightweight), GRID (regular grid for DEM, slope, etc.).

(3) Data Import, Export, and Conversion

Both ArcGIS and QGIS support importing/exporting Shapefile, GeoJSON, and TIFF via their respective UI dialogs. GDAL can be used for format conversion, e.g., Shapefile to GeoJSON.

from osgeo import ogr
in_ds = ogr.Open('input.shp')
in_layer = in_ds.GetLayer()
driver = ogr.GetDriverByName('GeoJSON')
out_ds = driver.CreateDataSource('output.geojson')
out_layer = out_ds.CopyLayer(in_layer, 'output_layer')
 del in_ds, out_ds

3. GPS and Trajectory Data

(1) GPS Technology and Principles

GPS determines a 3‑D position by triangulating signals from at least four satellites; other constellations include GLONASS, Galileo, and BeiDou, each with distinct characteristics.

(2) Acquiring and Processing GPS Trajectories

Raw GPS data often contain noise; typical preprocessing steps involve removing duplicates, outlier detection using z‑scores, and smoothing with Savitzky‑Golay filters.

import pandas as pd, numpy as np
from scipy.signal import savgol_filter

data = pd.read_csv('gps_trajectory.csv')
# Remove duplicates
data = data.drop_duplicates(subset=['latitude','longitude','time'])
# Outlier detection
z_lat = np.abs((data['latitude']-data['latitude'].mean())/data['latitude'].std())
z_lon = np.abs((data['longitude']-data['longitude'].mean())/data['longitude'].std())
threshold = 3
data = data[(z_lat < threshold) & (z_lon < threshold)]
# Smoothing
window, order = 5, 2
data['latitude_smoothed'] = savgol_filter(data['latitude'], window, order)
data['longitude_smoothed'] = savgol_filter(data['longitude'], window, order)
print(data.head())

(3) Common GPS Trajectory File Formats

GPX (XML, widely supported), FIT (compact, Garmin), TCX (Garmin), KML (Google Earth).

4. Trajectory Visualization

(1) Using GIS Software

ArcGIS can create high‑quality map documents with styled trajectory layers; QGIS offers similar capabilities with a lower learning curve.

(2) Using Programming Languages

Python libraries such as folium and matplotlib enable interactive web maps and static visualizations.

# Simple folium trajectory example
import folium, pandas as pd

data = pd.read_csv('gps_trajectory.csv')
m = folium.Map(location=[data.iloc[0]['latitude'], data.iloc[0]['longitude']], zoom_start=10)
for _, row in data.iterrows():
    folium.Marker(location=[row['latitude'], row['longitude']], popup=f"Time: {row['time']}").add_to(m)
if 'latitude' in data.columns and 'longitude' in data.columns:
    coords = list(zip(data['latitude'], data['longitude']))
    folium.PolyLine(locations=coords, color='blue', weight=2.5, opacity=1).add_to(m)
 m.save('trajectory_map.html')

5. Spatial Analysis and Path Planning

(1) Basic Spatial Analysis Techniques

Buffer analysis creates zones around features; overlay analysis combines multiple layers to examine spatial relationships.

import geopandas as gpd
factory = gpd.read_file('factory.shp')
buffer = factory.buffer(5000)  # 5 km buffer
buffer.to_file('factory_buffer.shp')

(2) Path‑Planning Algorithms

Dijkstra computes shortest paths on weighted graphs; A* adds a heuristic to accelerate search.

import heapq
def dijkstra(graph, start):
    dist = {n: float('inf') for n in graph}
    dist[start] = 0
    pq = [(0, start)]
    while pq:
        cur_dist, node = heapq.heappop(pq)
        if cur_dist > dist[node]:
            continue
        for nbr, w in graph[node].items():
            nd = cur_dist + w
            if nd < dist[nbr]:
                dist[nbr] = nd
                heapq.heappush(pq, (nd, nbr))
    return dist

graph = {'A':{'B':1,'C':4},'B':{'A':1,'C':2,'D':5},'C':{'A':4,'B':2,'D':1},'D':{'B':5,'C':1}}
print(dijkstra(graph, 'A'))

(3) Implementing Path Planning with Python

NetworkX provides high‑level graph operations and integrates with Matplotlib for visualization.

import networkx as nx, matplotlib.pyplot as plt
G = nx.DiGraph()
G.add_weighted_edges_from([('A','B',2),('A','C',4),('B','C',1),('B','D',7),('C','D',3),('D','E',2)])
path = nx.dijkstra_path(G, 'A', 'E')
length = nx.dijkstra_path_length(G, 'A', 'E')
print('Shortest path:', ' -> '.join(path))
print('Length:', length)
pos = nx.spring_layout(G)
nx.draw(G, pos, with_labels=True, node_color='lightblue')
edge_labels = nx.get_edge_attributes(G, 'weight')
nx.draw_networkx_edge_labels(G, pos, edge_labels=edge_labels)
plt.title('Simple Path Planning')
plt.show()

6. Real‑Time vs. Historical Trajectories

(1) Real‑Time Trajectories

Continuously streamed positions enable live tracking in ride‑hailing, logistics, and emergency response; accuracy is enhanced by fusing GPS with cellular and Wi‑Fi positioning.

(2) Historical Trajectories

Stored after movement ends, they support analysis for urban planning, marketing, health monitoring, and security investigations.

7. Recent Developments in Trajectory Technology

(1) Intelligent Trajectory Computing Platforms

Cloud‑based AI services now process spatio‑temporal data at scale, offering risk assessment and multi‑party interaction for freight logistics.

(2) Cross‑Domain Fusion

Integration with autonomous driving, digital twins, and large‑scale traffic perception models is driving smarter navigation and city management.

(3) High‑Precision Maps and Trajectory Data

Combining centimeter‑level positioning with detailed maps improves navigation, traffic flow monitoring, and congestion prediction.

8. Summary and Outlook

Map trajectory technology is expanding from basic navigation to complex urban and intelligent transportation systems. Future progress will be powered by AI, big data, and IoT, delivering more accurate, intelligent, and efficient solutions while continuously refining accuracy‑assessment methods.

PythonGPSpath planningSpatial AnalysisGISmap trajectory
JD Tech Talk
Written by

JD Tech Talk

Official JD Tech public account delivering best practices and technology innovation.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.