# Metadata for Survey Management System QGIS Plugin

[general]
name=Survey Management System
qgisMinimumVersion=3.22
qgisMaximumVersion=4.99
description=Digital archiving system for Nigerian cadastral survey records with DWG/DXF import, AI data extraction, coordinate/traverse calculations, document management, a built-in survey database file (nothing to install) or a shared PostgreSQL/PostGIS database, and PlotAccess — a road-aware, exact-area cadastral subdivision engine.
version=3.0.0
author=ASTROMAT GEO-SERVICES
email=ugwusochukwuma@gmail.com

about=Comprehensive digital archiving system for Nigerian survey records, now with PlotAccess: an automated, road-aware cadastral subdivision engine.

  FEATURES:
  - PlotAccess — road-aware, exact-area cadastral subdivision, with
    automatic road layout and hard road-access enforcement
  - AutoCAD DWG and DXF import with AI-powered metadata extraction (no
    extra software to install)
  - Bearing and distance traverse calculator (WCB and quadrant, DMS input)
  - 1:5000 Nigerian Survey Regulations precision ratio check
  - Coordinate input with PostGIS spatial storage
  - Document upload with MD5 checksum integrity verification
  - Three-tier access control (superuser, surveyor, viewer)
  - Full audit trail of all actions
  - Global search across all database tables
  - Adjoining survey boundary detection
  - Works on QGIS 3.22+ and QGIS 4
  - First-run setup wizard asks one question: just me, or a shared office?
  - Just me: all records in one survey database file (GeoPackage) on this
    computer -- nothing else to install; one-click backup
  - Shared office: PostgreSQL + PostGIS server (existing server, or an
    advanced one-click server on this computer via Docker)

  REQUIREMENTS: nothing beyond QGIS for the survey database file, DWG
  import and DXF import/export (the plugin reads DWG and DXF itself). Optional
  parts install themselves with one click when first used: Shapely
  (PlotAccess, about 2 MB) and psycopg2 (shared office database: a
  PostgreSQL 12+ server with PostGIS, or Docker Desktop).

tracker=https://github.com/Sochukwumaobim/surveymanagement/issues
repository=https://github.com/Sochukwumaobim/surveymanagement
homepage=https://github.com/Sochukwumaobim/surveymanagement

hasProcessingProvider=no

changelog=
    Version 3.0.0 (October 2026):
    NEW: DWG drawings import directly -- AutoCAD R13/R14 to 2018 and later,
         including AutoCAD 2007 DWG -- with nothing to install. Everything
         DXF import does now works for DWG (boundary, traverse, beacon
         blocks and attributes, dimensions, leaders, text). ODA File
         Converter is no longer needed; if installed it is only used for
         drawings the built-in reader cannot open (e.g. R12-era DWG)
    NEW: Every object in a DWG is checked against its built-in checksum;
         damaged items are never imported silently -- the import says how
         many could not be read
    NEW: A drawing saved with the wrong extension (.dxf / .dwg) is
         recognised by its content and still imports
    NEW: PlotAccess loads its perimeter from DWG as well as DXF
    NEW: Plot on Map (coordinates, traverse, Show point, database layers)
         adds a satellite basemap underneath the survey once per project.
         A project that already has its own basemap is left alone, and a
         basemap you remove is not added back
    FIX: Plot on Map zoomed to the wrong place when the map was not in
         the survey's coordinate system
    NEW: PlotAccess report: plot numbers are fitted inside each plot and
         turned along it; large layouts get detail sheets at a standard
         scale (with key map, scale bar, north arrow and sheet extent) so
         every plot number is readable. Small layouts are unchanged
    FIX: PlotAccess report: road labels now sit on the road
    NEW: Survey database file -- a surveyor working alone needs nothing
         installed. All records live in one GeoPackage file on the
         computer (Documents/SurveyManagement by default) that QGIS and
         ArcGIS can also open. Database Settings has Back up now
    NEW: The Setup Wizard asks one plain question -- just me, or several
         computers sharing records -- and sets up the right database. The
         file cannot be put on a network drive (that can corrupt it)
    NEW: Every feature works the same on the file and on PostgreSQL:
         surveys, coordinates, traverses, adjoining-survey check,
         documents, search, map, Database Explorer, users and audit log
    NEW: One schema definition used everywhere (db_schema.py). Before,
         the tables were written out in four places (the cause of the
         v2.0.2 foreign-key error); now they cannot drift apart
    NEW: DXF import and export need nothing installed. The plugin now reads
         and writes DXF itself instead of downloading ezdxf (and four
         helper packages) on first use -- that download could fail on
         some computers ("ezdxf was installed but still fails to
         import"). Checked against ezdxf on drawings in every DXF version
         from R12 to 2018
    FIX: DXF import of drawings saved as DXF R12, R2000 or R2004 garbled
         the degree sign, so no bearings were read (and on R12 no
         traverse was built). Bearings are now read from all versions
    FIX: Dimensions that show their measured value ("<>") were skipped
         during DXF import; their distances are now read
    FIX: Text with special characters stored as \U+ codes lost part of
         the text (e.g. half of a title block) during DXF import
    FIX: PlotAccess DXF export: coordinate labels now show E and N on two
         lines (they used to run together as E=...N=...), and centred
         labels carry their alignment point so AutoCAD keeps them in place.
         Files are written as DXF R12, which every CAD and GIS program opens
    NEW: PlotAccess can load its perimeter from older (R12) DXF drawings
    FIX: Window titles, help and the DXF title block now show the real
         plugin version (they said v2.0)
    FIX: A damaged number in a DXF stops the import with a clear message
         instead of importing a wrong coordinate
    NEW: PlotAccess no longer needs SciPy (a 30-40 MB library it used for
         one function). That function, Brent's method for exact plot
         areas, is now built in; checked to give identical results
    NEW: If Shapely is missing, PlotAccess offers a one-click install
         (about 2 MB) like DXF import does, instead of failing to open.
         QGIS's own numpy is never replaced
    FIX: Databases set up by the old Setup Wizard (v2.0.2 and earlier)
         are repaired automatically the first time v3 connects -- no
         reinstall, no manual steps. Wrong-format tables are rebuilt in
         one safe step (all or nothing); any records in them are carried
         over and the old tables are kept as a backup. Healthy databases
         are not touched. Databases the old wizard left half-finished
         (some tables missing) are completed in the same step. A staff login without permission to change
         tables gets a clear message to ask the administrator to open the
         plugin once
    FIX: Map zoom after Show point, Plot coordinates and Plot traverse
         failed in QGIS (the main window was used instead of the QGIS
         interface), so the map never moved to the result
    FIX: Staff accounts without permission to create tables (the
         default for new users on PostgreSQL 15+) got errors on every
         start, and the next query failed too. Tables are now only
         created when missing, and a failure no longer breaks the
         connection
    FIX: Login failed outright when psycopg2 was not installed
    FIX: psycopg2 installed by the wizard is used straight away, without
         restarting QGIS
    FIX: Adjoining-survey check no longer errors when boundaries are
         saved in different coordinate systems
    FIX: Search for boundaries by verified status
    NEW: Advanced: a shared office database can be installed on this
         computer with Docker, from the official postgis/postgis image
         (PostgreSQL 17 + PostGIS 3.5). Data lives in a Docker volume and
         survives restarts and updates. Reachable from this computer
         only, unless you tick the office-network option
    NEW: Picks a free port automatically if another PostgreSQL already
         uses 5432; generates a strong random database password
    NEW: Database Settings, Local Database (Docker): update engine to the
         latest bug-fix release (automatic backup first), back up now,
         stop, reset
    NEW: When QGIS starts and the local database is not running (e.g.
         after a reboot), the plugin starts Docker and the database for you
    FIX: The Setup Wizard saved the database username under a key the
         rest of the plugin never read, so any login other than
         postgres entered in the wizard was ignored
    NEW: Runs on both QGIS 3 (3.22 or later) and QGIS 4 from the same
         package. All Qt names use the form that works on Qt5 and Qt6;
         QAction, message levels, geometry types and attribute field
         types are resolved for the running QGIS version
    FIX: Plugin no longer fails to start when QGIS has no saved locale

    Version 2.0.3 (October 2026):
    FIX: The CRS picker mislabelled the Minna codes. "Nigeria Mid Belt"
         was EPSG:26332, which is actually Minna / UTM zone 32N, so
         surveys saved with the default CRS were stored with the wrong
         SRID. "Nigeria East" was EPSG:26333, which does not exist.
         The list now offers 26391/26392/26393 (Minna / Nigeria West,
         Mid and East Belt) plus Minna UTM 31N/32N under their real
         names, and the default is 26392. Records saved earlier keep
         their stored SRID and must be corrected in the database
    FIX: Show-on-map now uses each point's stored SRID instead of a
         hardcoded EPSG:26332
    FIX: Setup wizard tip pointed Imo/eastern states to the
         non-existent EPSG:26333; it now points to 26392 (Mid Belt)
    FIX: Replaced remaining bare except clauses
    FIX: Removed the bundled lib/ folder (pre-packaged ezdxf, pyparsing,
         typing_extensions). The QGIS Plugin Repository's security scan
         checks every file in the package, including vendored
         third-party code -- ezdxf's own upstream source uses assert
         statements in several places, which the scanner flags
         regardless of whose code it's in, and blocked v2.0.2 with 472
         issues as a result. All dependencies (ezdxf, numpy, pyparsing,
         fontTools, typing_extensions) now install on first real use via
         the plugin's own installer instead of being pre-bundled --
         see the v2.0.1 fix below, which already made this work
         correctly without needing anything pre-packaged
    FIX: The first-run Setup Wizard and Database Settings' Auto-Setup
         Database used two different, independent schema definitions
         for the same tables -- the Setup Wizard named every primary
         key "id", while Auto-Setup Database used table-specific names
         (survey_id, point_id, leg_id, etc.), which is what the rest of
         the plugin actually depends on. Because table creation uses
         "IF NOT EXISTS", whichever wizard ran first for a given user
         silently "won" -- and if a user's database ended up with a
         partial run of the old wizard (e.g. just the surveys table)
         before later using Auto-Setup Database, that path's own
         foreign-key constraints would fail with "column ... referenced
         in foreign key constraint does not exist". Reproduced this
         exact error against a real PostgreSQL 16 + PostGIS instance
         before fixing it, and verified the fix resolves it. The Setup
         Wizard's schema now exactly matches Auto-Setup Database's,
         including the two tables (app_users, audit_log) it was
         missing entirely
    FIX (defensive, not confirmed as a common issue -- one real report
         so far): installing ezdxf's dependencies (2.0.1) could install
         or upgrade numpy even when a working numpy was already
         present, which could in principle affect road_aware_engine.py /
         parcellation_engine.py (the Parcellation Module's geometry
         engine), since they import shapely/scipy unconditionally with
         no install management of their own. The installer now checks
         whether numpy is already importable first, and if so, never
         lets ezdxf's install touch it. Also corrected the
         "Could not load parcellation module" error message, which
         always suggested checking for missing files even when the
         underlying error was unrelated

    Version 2.0.2 (August 2026):
    FIX: DXF import in the Parcellation Module (PlotAccess) never
         actually installed ezdxf on a fresh system -- it only tried a
         bare import twice, then told the user to go use the *main*
         plugin's DXF import instead. That only "worked" because the
         main plugin was the one place that actually called the
         installer. Parcellation's DXF import now calls the same
         installer directly and is fully self-contained -- no need to
         open the main plugin first

    Version 2.0.1 (August 2026):
    FIX: DXF import in PlotAccess opened files in binary mode, but
         ezdxf.read() requires a text stream -- every DXF import failed
         with "a bytes-like object is required, not 'str'"
    FIX: ezdxf's dependency installer used --no-deps, skipping numpy,
         pyparsing, fontTools, and typing_extensions -- all four are
         required just to import ezdxf, regardless of which features
         are used, so any environment without them already present
         (independently of this plugin) could never complete a DXF
         import no matter how many times ezdxf was reinstalled
    FIX: dependency availability checks only verified an "ezdxf" folder
         existed on disk, never that it could actually be imported --
         so a broken install could be reported as working
    FIX: DXF-extracted coordinates could be numpy.float64 rather than
         plain float; normalized at the point of extraction

    Version 2.0.0 (August 2026):
    NEW: PlotAccess — road-aware, exact-area cadastral subdivision engine
    NEW: Automatic road layout — roads are computed by the engine, no
         manual road drawing required
    NEW: Hard road-access constraint — every plot must front a real
         road corridor; landlocked plots resolved automatically
    NEW: Exact target area on the large majority of plots via
         Brent's-method root-finding, not approximate rounding
    NEW: Parcellation dialog — paste/import perimeter coordinates,
         configurable plot area, frontage, road width, cross-road spacing
    NEW: Colour-coded plan output with compliant/edge plot status
    NEW: Area schedule and setting-out coordinate tables
    NEW: Export to DXF, Excel, or a branded PDF report; direct print
    FIX: Corrected a font double-scaling bug in the PDF report generator
    FIX: Redesigned PDF report layout — branded header/footer, page
         numbers, zebra-striped tables, colour-coded status

    Version 1.2.0 (April 2026):
    NEW: AutoCAD DXF/DWG import — extract beacon coordinates, traverse
         legs, bearings, distances and metadata from AutoCAD plan files
    NEW: AI-powered metadata extraction (plan number, owner, surveyor,
         LGA, state, date) via hosted server — no API key needed
    NEW: DXF import preview dialog — review and confirm before loading
    NEW: First-run setup wizard — installs psycopg2 and creates database
         automatically, no command line required
    NEW: User login with username and password (default: admin / admin123)
    NEW: Three-tier access control — superuser, surveyor, viewer roles
    NEW: Full audit trail in audit_log table
    NEW: User Administration panel for superusers
    NEW: Traverse precision ratio (1:5000 Nigerian Survey Regulations)
    NEW: Adjoining survey boundary detection via PostGIS ST_DWithin
    NEW: Custom CRS input with live EPSG validation
    FIX: Traverse delete button index bug corrected
    FIX: Documents tab index resolved using indexOf()

    Version 1.0.0 (March 2026):
    Initial release — survey metadata, coordinates, traverses,
    documents, PostgreSQL/PostGIS integration, global search.

tags=survey, cadastral, Nigeria, bearing, traverse, DXF, AutoCAD, PostgreSQL, PostGIS, land survey, coordinate, cadastral subdivision, parcellation, road-aware, PlotAccess, land parcel

category=Database
icon=icon.png

# Set to False — plugin is stable and tested
experimental=False

# Not deprecated
deprecated=False

server=False
