Global

Members

(constant) FIPS_3900 :string

Description:
  • ${1:Description placeholder}

Source:

${1:Description placeholder}

Type:
  • string

(constant) PORT :number|string

Description:
  • The port on which the server will run.

Source:

The port on which the server will run.

Type:
  • number | string

(constant) WKID_3361 :string

Description:
  • ${1:Description placeholder}

Source:

${1:Description placeholder}

Type:
  • string

(constant) adminRouter :Router

Description:
  • Router for admin-related database operations.

Source:

Router for admin-related database operations.

Type:
  • Router

(constant) agent :https.Agent

Description:
  • HTTPS agent for handling requests with legacy SSL support.

Source:

HTTPS agent for handling requests with legacy SSL support.

Type:
  • https.Agent

(constant) app :express.Application

Source:
Type:
  • express.Application

(constant) client :MongoClient

Description:
  • MongoDB client instance used to connect to the database.

Source:

MongoDB client instance used to connect to the database.

Type:
  • MongoClient

(constant) doc :SwaggerDoc

Description:
  • Swagger documentation configuration object.

Source:

Swagger documentation configuration object.

Type:

(constant) endpointsFiles :Array.<string>

Description:
  • List of endpoint files to generate Swagger documentation for.

Source:

List of endpoint files to generate Swagger documentation for.

Type:
  • Array.<string>

(constant) router :express.Router

Description:
  • Express router for handling county-based parcel data requests.

Source:

Express router for handling county-based parcel data requests.

Type:
  • express.Router

(constant) router :*

Description:
  • Description placeholder

Source:

Description placeholder

Type:
  • *

Methods

GET(pin) → {string}

Description:
  • This controller is responsible for handling all requests

Source:
Example
"attributes": {
"spatialReference": "2273",
"LegalDescr": "BRIDGE CREEK PH II; LT 2 BL E",
"OwnerName": "N/F PETRARCA SCOTT D ",
"PIN": 44005020060,
"Address": "809 PEBBLE CREEK DR MYRTLE BEACH SC 29588",
"DeedBook": "3975",
"DeedPage": "1705",
"PlatBook": null,
"PlatPage": null,
"platRefText": "REFERENCE TO A MAP RECORDED IN PLAT BOOK: XXX, PAGE XXX AT THE HORRY COUNTY REGISTER OF DEEDS.",
"lastPropertySaleText": "LAST PROPERTY TRANSFER: 12/18/2016",
"lastPropertySaleDeedText": "DEED BOOK: 3975  PAGE: 1705"
},
Parameters:
Name Type Description
pin string

The pin to be used

Returns:
  • A string response
Type
string

authenticateToken(req, res, next)

Description:
  • Description placeholder

Source:
Parameters:
Name Type Description
req AuthenticatedRequest
res express.Response
next express.NextFunction

(async) dataFetch(baseUrl) → {Promise.<Array.<any>>}

Description:
  • Fetches all data layers from a GIS base URL.

Source:
Parameters:
Name Type Description
baseUrl string

The base URL for the GIS service.

Throws:

Will throw an error if data cannot be fetched or processed.

Returns:

An array of layer data.

Type
Promise.<Array.<any>>

doSegmentsIntersect(p1, p2, q1, q2)

Description:
  • Determines if two line segments intersect and returns the intersection point if they do.

Source:
Parameters:
Name Type Description
p1

The starting position of the first line segment as a tuple [x, y].

p2

The ending position of the first line segment as a tuple [x, y].

q1

The starting position of the second line segment as a tuple [x, y].

q2

The ending position of the second line segment as a tuple [x, y].

Returns:

The intersection point as a tuple [x, y] if the segments intersect within their bounds, otherwise null.

(async) fetchAllGis(baseUrl) → {Promise.<Array.<string>>}

Description:
  • Fetches both GIS folders and services and combines their URLs.

Source:
Parameters:
Name Type Description
baseUrl string

The base URL for the GIS service.

Throws:

Will throw an error if either folders or services cannot be fetched.

Returns:

An array of combined folder and service URLs.

Type
Promise.<Array.<string>>

fetchCountySchema(dbName, county)

Description:
  • Fetches the schema for a specific county from a MongoDB database.

Source:
Parameters:
Name Type Description
dbName

The name of the database to connect to.

county

The name of the county collection to fetch the schema from.

Throws:

Will log an error message if there is an issue retrieving data from the database.

Returns:

A promise that resolves to a CountySchema object containing the schema details. If the schema is not found or an error occurs, a default CountySchema object is returned.

fetchFloodData(state, county, geometry, res)

Description:
  • Fetches flood data based on state, county, and geometry if wgs84 is true, the spatial reference will be 4269, this is mainly usef for leaflet maps to prevent projection manipulation on the front end

Source:
Example
fetchFloodData('south-carolina', 'horry', 'geometry');
Parameters:
Name Type Description
state

The state parameter from the request

county

The county parameter from the request

geometry

Geometry query parameter

res

Express Response object

Returns:

Promise

(async) fetchGisFolders(baseUrl) → {Promise.<Array.<string>>}

Description:
  • Fetches GIS folders from a given base URL.

Source:
Parameters:
Name Type Description
baseUrl string

The base URL for the GIS service.

Throws:

Will throw an error if the data cannot be fetched or processed.

Returns:

An array of service URLs within the folders.

Type
Promise.<Array.<string>>

(async) fetchGisServices(baseUrl) → {Promise.<Array.<string>>}

Description:
  • Fetches GIS services directly from a given base URL.

Source:
Parameters:
Name Type Description
baseUrl string

The base URL for the GIS service.

Throws:

Will throw an error if the data cannot be fetched or processed.

Returns:

An array of service URLs within the services.

Type
Promise.<Array.<string>>

fetchParcelData(state, county, pin, res)

Description:
  • Fetches parcel data based on state, county, and PIN

Source:
Parameters:
Name Type Description
state

The state parameter from the request

county

The county parameter from the request

pin

Optional PIN for parcel lookup

res

Express Response object

fetchZoningData(state, county, geometry, res)

Description:
  • Fetches zoning data based on state, county, and geometry

Source:
Parameters:
Name Type Description
state

The state parameter from the request

county

The county parameter from the request

geometry

Geometry query parameter

res

Express Response object

Returns:

Promise

generateMarkdown(swaggerData) → {string}

Description:
  • Converts Swagger documentation JSON into a Markdown string for use in a README file.

Source:
Example
const markdown = generateMarkdown(swaggerData);
console.log(markdown);
Parameters:
Name Type Description
swaggerData Object

The Swagger documentation JSON object.

Returns:

The generated Markdown string.

Type
string

isPointInsidePolygon(point, polygon)

Description:
  • Determines if a given point is inside a polygon.

    This function uses the ray-casting algorithm to determine if the point is inside the polygon. It works by drawing a horizontal line from the point to the outside of the polygon and counting how many times the line intersects with the edges of the polygon. If the number of intersections is odd, the point is inside the polygon. If even, the point is outside.

Source:
Parameters:
Name Type Description
point

The point to check, represented as a tuple [x, y].

polygon

The polygon to check against, represented as an array of paths, where each path is an array of points [x, y]. The first path in the array is considered the outer boundary of the polygon.

Returns:

true if the point is inside the polygon, false otherwise.

offsetPolygon(polygonCoords, offsetDistance, spatialReference)

Description:
  • Offsets a polygon by a given distance and reprojects the coordinates.

Source:
Parameters:
Name Type Description
polygonCoords

The coordinates of the polygon to be offset. It is a 3D array of numbers.

offsetDistance

The distance by which to offset the polygon.

spatialReference

The spatial reference system identifier (e.g., EPSG code) for the input coordinates.

Throws:

Will throw an error if the offset polygon is undefined.

Returns:

The new polygon with offset coordinates in the original projection.

splitPathAtIntersection(polygon1, polygon2)

Description:
  • Splits the path of the first polygon at intersections with the second polygon and merges the resulting paths.

Source:
Parameters:
Name Type Description
polygon1

The first polygon represented as an array of arrays of positions (coordinates).

polygon2

The second polygon represented as an array of arrays of positions (coordinates).

Returns:

An array containing the merged paths after splitting at intersections.

The function works as follows:

  1. Initializes an empty array splitPaths to store the resulting paths.
  2. Extracts the first path from each polygon (path1 and path2).
  3. Iterates through each segment of the first polygon (path1).
  4. For each segment, checks if the start point is inside the second polygon (polygon2).
  5. Checks for intersections between the current segment of the first polygon and all edges of the second polygon.
  6. If an intersection is found, starts a new path from the intersection point.
  7. Adds the end point of the current segment to the current path if it is inside the second polygon.
  8. Ensures no duplicate points are added by checking the last point in the current path.
  9. Merges the resulting paths and returns the merged path.

Type Definitions

SwaggerDoc

Source:
Properties:
Name Type Description
info SwaggerInfo

Information about the API.

host string

The host URL for the API.

servers Array.<SwaggerServer>

An array of server objects.

Type:
  • Object

SwaggerInfo

Source:
Properties:
Name Type Description
title string

The title of the API.

description string

The description of the API.

version string

The version of the API.

Type:
  • Object

SwaggerServer

Source:
Properties:
Name Type Description
url string

The server URL.

Type:
  • Object