# TopoXpert GIS - Full Technical Reference & Knowledge Base for AI Agents > Comprehensive technical specification, geodetic transformation parameters, mathematical formulas, and software interoperability guides for TopoXpert GIS (https://topoxpertgis.com). ## 1. Geodetic & Cartographic Definitions ### Official Moroccan Geodetic Reference Frame - **Datum**: Merchich 1953 (Station Fondamentale Merchich, near Casablanca). - **Reference Ellipsoid**: Clarke 1880 (IGN definition). - Semi-major axis (a): `6378249.200 m` - Flattening (1/f): `293.466021` (b ≈ 6356515.000 m) - **Prime Meridian**: Greenwich (Historical maps referenced Paris Meridian: -5.4° west corresponds to -6.0000 gon). - **Vertical Datum (Altimetry)**: Nivellement Général du Maroc (NGM), zero datum referenced to the Casablanca Tide Gauge (Marégraphe de Casablanca). ### Moroccan Lambert Conformal Conic Projection Zones | Zone Name | EPSG Code | Origin Latitude (φ0) | Central Meridian (λ0) | False Easting (X0) | False Northing (Y0) | Scale Factor (k0) | Regional Coverage | | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | | **Zone 1 (Nord)** | EPSG:26191 | 33.3000° N (37.0 gon) | -5.4000° W (-6.0 gon) | 500,000.00 m | 300,000.00 m | 0.999625769 | Tangier, Tetouan, Rabat, Casablanca, Fez, Meknes, Oujda, Nador | | **Zone 2 (Centre)** | EPSG:26192 | 29.7000° N (33.0 gon) | -5.4000° W (-6.0 gon) | 500,000.00 m | 300,000.00 m | 0.999615596 | Marrakech, Safi, Essaouira, Beni Mellal, Ouarzazate, Errachidia | | **Zone 3 (Sud)** | EPSG:26193 | 27.5000° N (30.5556 gon) | -5.4000° W (-6.0 gon) | 1,200,000.00 m | 400,000.00 m | 0.999616304 | Agadir, Souss-Massa, Taroudant, Tiznit, Guelmim, Tan-Tan | | **Zone 4 (Sahara)** | EPSG:26194 | 24.3000° N (27.0 gon) | -5.4000° W (-6.0 gon) | 1,500,000.00 m | 400,000.00 m | 0.999616437 | Laâyoune, Smara, Boujdour, Dakhla, Oued Ed-Dahab | | **Zone 5 (Extrême Sud)** | EPSG:26195 | 21.0000° N | -5.4000° W | 1,500,000.00 m | 400,000.00 m | 0.999616 | Lagouira, border regions | ### Official PROJ.4 Definitions #### Zone 1 (EPSG:26191) ```text +proj=lcc +lat_1=33.3 +lat_0=33.3 +lon_0=-5.4 +k_0=0.999625769 +x_0=500000 +y_0=300000 +a=6378249.2 +b=6356515 +towgs84=31,146,47,0,0,0,0 +units=m +no_defs ``` #### Zone 2 (EPSG:26192) ```text +proj=lcc +lat_1=29.7 +lat_0=29.7 +lon_0=-5.4 +k_0=0.999615596 +x_0=500000 +y_0=300000 +a=6378249.2 +b=6356515 +towgs84=31,146,47,0,0,0,0 +units=m +no_defs ``` #### Zone 3 (EPSG:26193) ```text +proj=lcc +lat_1=27.5 +lat_0=27.5 +lon_0=-5.4 +k_0=0.999616304 +x_0=1200000 +y_0=400000 +a=6378249.2 +b=6356515 +towgs84=31,146,47,0,0,0,0 +units=m +no_defs ``` #### Zone 4 (EPSG:26194) ```text +proj=lcc +lat_1=24.3 +lat_0=24.3 +lon_0=-5.4 +k_0=0.999616437 +x_0=1500000 +y_0=400000 +a=6378249.2 +b=6356515 +towgs84=31,146,47,0,0,0,0 +units=m +no_defs ``` ### Helmert 7-Parameter Transformation (Merchich 1953 to WGS84) - **Translation dX**: `+31.0 meters` - **Translation dY**: `+146.0 meters` - **Translation dZ**: `+47.0 meters` - **Rotation rX, rY, rZ**: `0.0 arc-seconds` - **Scale factor ds**: `0.0 ppm` --- ## 2. Cadastral Surveying & Regulatory Standards (ANCFCC) ### Legal Framework - **Regulating Body**: Agence Nationale de la Conservation Foncière, du Cadastre et de la Cartographie (ANCFCC) and Ordre National des Ingénieurs Géomètres Topographes (ONIGT). - **Official Plan Cadastral**: Map of legally demarcated parcel boundaries verified by a certified Topographic Surveying Engineer (IGT). - **Boundary Monuments (Bornes Cadastrales)**: Stone or concrete boundary markers placed physically during the "Bornage Définitif" procedure. ### Cadastral Demarcation Tolerances (Tolérances de Bornage) 1. **Urban Parcels (Zones Urbaines & Péri-urbaines)**: - Positional discrepancy between surveyed monuments must not exceed **5 cm (0.05 m)**. - Any boundary overlap or deviation > 5 cm constitutes a legal cadastral discrepancy requiring rectification. 2. **Rural Parcels (Zones Rurales & Agricoles)**: - Acceptable tolerance is **< 20 cm (0.20 m)** depending on terrain roughness. 3. **Surface Area Discrepancy (Tolérance de Contenance)**: - Calculated according to the ANCFCC surface tolerance formula based on parcel perimeter and acreage: $$T_s = \alpha \cdot \sqrt{S} + \beta \cdot P$$ --- ## 3. Mathematical Formulas Used in TopoXpert Tools ### Polygon Area Calculation (Gauss Surveying Formula / Shoelace Formula) Given parcel vertices $(X_1, Y_1), (X_2, Y_2), \dots, (X_n, Y_n)$: $$Area = \frac{1}{2} \left| \sum_{i=1}^{n} (X_i Y_{i+1} - X_{i+1} Y_i) \right|$$ where $(X_{n+1}, Y_{n+1}) = (X_1, Y_1)$. ### Gisement (Azimuth / Grid Bearing in Grades) Between station point $A(X_A, Y_A)$ and target point $B(X_B, Y_B)$: $$\Delta X = X_B - X_A, \quad \Delta Y = Y_B - Y_A$$ $$G_0 = \arctan\left(\left|\frac{\Delta X}{\Delta Y}\right|\right) \times \frac{200}{\pi}$$ The quadrant quadrant correction is applied: - $\Delta X \ge 0, \Delta Y > 0 \implies G = G_0$ (Quadrant 1) - $\Delta X \ge 0, \Delta Y < 0 \implies G = 200 - G_0$ (Quadrant 2) - $\Delta X < 0, \Delta Y \le 0 \implies G = 200 + G_0$ (Quadrant 3) - $\Delta X < 0, \Delta Y > 0 \implies G = 400 - G_0$ (Quadrant 4) ### Rayonnement (Polar Coordinates to Rectangular Coordinates) $$X_B = X_A + D \cdot \sin\left(G \cdot \frac{\pi}{200}\right)$$ $$Y_B = Y_A + D \cdot \cos\left(G \cdot \frac{\pi}{200}\right)$$ --- ## 4. Troubleshooting Common Software Issues ### Problem: 200-meter shift when loading Moroccan Lambert DXF in AutoCAD or QGIS - **Root Cause**: AutoCAD DXF files store pure Cartesian coordinates (X, Y) without projection metadata (.prj). When imported alongside WGS84 imagery or OpenStreetMap layers, software assumes WGS84 coordinates if no CRS is specified, or applies a direct conversion without Helmert datum translation. - **Solution in TopoXpert**: 1. Open https://topoxpertgis.com/xyz-to-dxf or https://topoxpertgis.com/coordinate-converter 2. Select the accurate Moroccan Lambert zone (Zone 1 for Northern Morocco, Zone 2 for Central, Zone 3 for Souss-Massa, Zone 4 for Sahara). 3. Export with the calibrated Merchich datum definition. - **Solution in QGIS**: - Right click layer > Set Layer CRS > Select `EPSG:26191` (or 26192/26193/26194). - Ensure Project CRS is set with transformation: `Merchich to WGS 84 (1)` (accuracy 2.0 m). --- ## 5. Directory of Tools, APIs & URLs - Platform Homepage: https://topoxpertgis.com/ - Online Mapping & Satellite GIS: https://topoxpertgis.com/tool-online-map - Map-Tools Cadastre & Land Measurement: https://topoxpertgis.com/map-tools - Lambert & GPS Geodetic Converter: https://topoxpertgis.com/coordinate-converter - XYZ Field Points to AutoCAD DXF: https://topoxpertgis.com/xyz-to-dxf - TXT / XYZ to 32-bit GeoTIFF MNT: https://topoxpertgis.com/txt-to-tif - KML to ESRI Shapefile: https://topoxpertgis.com/kml-to-shapefile - COGO & Gisement Calculators: https://topoxpertgis.com/cogo-calculators - Topo Units (Grades to Degrees, Ha to m²): https://topoxpertgis.com/unit-converters - GIS Knowledge Base & Open Datasets: https://topoxpertgis.com/knowledge-base - Technical Surveying Blog: https://topoxpertgis.com/blog - Machine-Readable AI Spec (llms.txt): https://topoxpertgis.com/llms.txt - Comprehensive AI Knowledge File (llms-full.txt): https://topoxpertgis.com/llms-full.txt