Fundamentals 31 min read

Unlocking Map Trajectory Technology: From GIS Basics to Real‑Time Tracking

This comprehensive guide explores the fundamentals of GIS, map data formats, GPS trajectory processing, visualization techniques, spatial analysis, path‑planning algorithms, and the latest advancements in real‑time and historical trajectory technologies, providing practical code examples for developers.

JD Cloud Developers
JD Cloud Developers
JD Cloud Developers
Unlocking Map Trajectory Technology: From GIS Basics to Real‑Time Tracking

Recently JD announced its entry into the food‑delivery market, featuring a real‑time map trajectory that shows the rider's location from the restaurant to the customer, highlighting the underlying map trajectory technology.

1. Fundamentals of GIS

Geographic Coordinate Systems

The WGS84 standard is the global reference for latitude and longitude used by GPS, while the UTM projection divides the earth into 60 zones for precise planar calculations, though cross‑zone conversions can be complex.

Projections and Coordinate Transformations

Map projections such as Gauss‑Krüger (suitable for mid‑latitude regions) and Mercator (ideal for maritime navigation) convert the earth's curved surface to a flat map, with coordinate transformations bridging different systems.

Basic GIS Software Operations

ArcGIS offers comprehensive spatial analysis tools but comes with high cost and learning curve, whereas QGIS is free, extensible, and beginner‑friendly. Users can load vector and raster layers, perform distance and area calculations, and extend functionality via Python plugins.

<code>from qgis.core import QgsApplication, QgsProject
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 = [f.name() for f in layer.fields()]
        print(f"Field names: {', '.join(fields)}")
    print('-' * 50)
qgs.exitQgis()</code>

2. Map Data Formats and Processing

Common Map Data Formats

Shapefile : Consists of .shp, .shx, .dbf files; stores points, lines, polygons; widely used for basic GIS data exchange.

GeoJSON : JSON‑based, human‑readable; supports multiple geometry types; ideal for web and mobile GIS applications.

KML : XML‑based format from Google for visualizing geographic data in Google Earth and other platforms.

TIFF : Raster image format used for satellite imagery and DEMs; supports georeferencing.

JPEG : Compressed raster format suitable for quick display of base maps.

GRID : Regular grid raster format for continuous data such as elevation models.

Data Import, Export and Conversion

Both ArcGIS and QGIS support importing and exporting Shapefile, GeoJSON, and raster formats through their respective catalog or layer dialogs. GDAL can be used for batch conversion, for example converting Shapefile to GeoJSON:

<code>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</code>

3. GPS and Trajectory Data

GPS Technology and Working Principle

GPS receivers calculate three‑dimensional position by triangulating signals from at least four satellites. Other global navigation satellite systems such as GLONASS, Galileo, and BeiDou provide alternative coverage and additional features like short‑message communication.

Acquiring and Processing GPS Trajectory Data

Raw GPS logs often contain noise; preprocessing steps include removing duplicate points, filtering outliers using Z‑score, and smoothing trajectories with a Savitzky‑Golay filter. Python libraries pandas, numpy, and scipy facilitate these operations.

<code>import pandas as pd
import numpy as np
from scipy.signal import savgol_filter

data = pd.read_csv('gps_trajectory.csv')
data = data.drop_duplicates(subset=['latitude','longitude','time'])
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)]
window, poly = 5, 2
data['latitude_smoothed'] = savgol_filter(data['latitude'], window, poly)
data['longitude_smoothed'] = savgol_filter(data['longitude'], window, poly)
print(data.head())</code>

Common GPS Trajectory File Formats

GPX : XML format storing waypoints, tracks, timestamps; widely supported.

FIT : Compact binary format from Garmin for fitness devices.

TCX : Garmin’s Training Center XML format for activity data.

KML : Used by Google Earth for geographic visualization.

4. Map Trajectory Visualization

Python libraries such as folium can create interactive maps with markers and polylines to display trajectories.

<code>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')</code>

5. Spatial Analysis and Path Planning

Basic Spatial Analysis Techniques

Buffer analysis creates zones around features to assess impact, while overlay analysis combines multiple layers to evaluate spatial relationships, useful in environmental impact studies and urban planning.

<code>import geopandas as gpd
factory = gpd.read_file('factory.shp')
buffer = factory.buffer(5000)
buffer.to_file('factory_buffer.shp')</code>

Path‑Planning Algorithms

Dijkstra computes the shortest path by exploring all nodes, guaranteeing optimality but can be slow on large graphs. A* adds a heuristic to guide the search, improving efficiency for complex networks.

<code>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'))</code>

Python’s networkx library can also perform shortest‑path calculations and visualizations.

<code>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')
nx.draw_networkx_edge_labels(G, pos, edge_labels=nx.get_edge_attributes(G,'weight'))
plt.title('Simple Path Planning')
plt.show()</code>

6. Real‑Time vs. Historical Trajectories

Real‑Time Trajectories

Live tracking updates positions continuously, requiring high‑frequency data transmission and robust network connectivity. Accuracy can be enhanced by fusing GPS with cellular, Wi‑Fi, or base‑station data, reducing large‑error occurrences in urban canyons.

Historical Trajectories

Stored after movement ends, historical tracks support analysis of travel patterns, city planning, commercial site selection, health monitoring, and security investigations.

7. Latest Developments in Trajectory Technology

Intelligent Trajectory Computing Platforms

Cloud‑based services such as the “Yunji” platform apply AI models to process spatiotemporal data in real time, enabling risk assessment for freight vehicles and multi‑party intervention.

Cross‑Domain Fusion

Integration with autonomous driving, digital twins, and large‑scale traffic perception models enhances navigation precision, virtual traffic management, and decision‑making.

Lane‑Level Real‑Time Synchronization

Systems offering “dual convergence, dual circulation” deliver minute‑level updates on incidents, road closures, and weather alerts across multiple channels.

High‑Precision Maps Combined with Trajectory Data

Coupling centimeter‑level maps with vehicle trajectories improves traffic flow monitoring, congestion prediction, and intelligent transportation planning.

8. Conclusion and Outlook

Map trajectory technology is expanding from basic navigation to complex urban planning and intelligent traffic systems. Future progress driven by AI, big data, and IoT will deliver more accurate, intelligent, and efficient solutions, while trajectory accuracy evaluation will continue to evolve to meet new application demands.

PythonGPSpath planningspatial analysisGISmap trajectory
JD Cloud Developers
Written by

JD Cloud Developers

JD Cloud Developers (Developer of JD Technology) is a JD Technology Group platform offering technical sharing and communication for AI, cloud computing, IoT and related developers. It publishes JD product technical information, industry content, and tech event news. Embrace technology and partner with developers to envision the future.

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.