# EES Puerto Rico Open Atlas

A portable, open-source browser GIS for Puerto Rico. Plain HTML, CSS and JavaScript, with locally bundled dependencies. No application server, paid API key, build step, PHP or database is required. Application code: MIT. Dataset and imagery rights remain with their publishers.

## Deploy on GoDaddy or another Linux shared host

1. Download and extract `puerto-rico-open-atlas.zip` on your computer.
2. Open the extracted `puerto-rico-open-atlas` folder. It contains `index.html`, `assets`, `vendor`, `data`, and the documentation.
3. In your host's File Manager or an SFTP client, create a directory such as `public_html/atlas/`. Upload **the contents** of the extracted folder there, preserving every subdirectory and filename. Do not upload the ZIP alone and expect it to execute. Some hosts call the document root `httpdocs` or `www`.
4. Open `https://YOUR-DOMAIN/atlas/`. For a root deployment, upload the same contents directly into your domain's document root, taking care not to overwrite another website.
5. Enable your host's HTTPS certificate. Offline service-worker caching requires HTTPS (localhost is also supported by browsers). No URL rewriting is required. All local paths are relative so a subfolder deployment works.
6. If a map service fails, test its publisher link. Browser CORS restrictions and a publisher's service outages cannot be fixed simply by moving this static application. There is no open proxy in this package.

You do not need to run npm, install Node.js, configure Cloudflare, or retain any ChatGPT hosting connection. The download contains the complete original application source. The host does not need outgoing network access: live map requests originate in visitors' browsers.

To offer the download button on your own host, place a copy of the original ZIP next to `index.html`, named `puerto-rico-open-atlas.zip`. The ZIP deliberately does not contain itself. Alternatively, remove the download link from `index.html`.

## Run locally

Serve the folder with any static web server. For example, on a Linux computer with Python installed:

```bash
cd /path/to/puerto-rico-open-atlas
python3 -m http.server 8000
```

Open `http://localhost:8000/`. Do not double-click `index.html` using `file://`: browsers block local JSON fetches in that context.

## What is included

- 50 selectable map layers and 10 additional discovery portals in the initial catalog, plus 17 agency/data directories. This is a substantial starter catalog, **not every available dataset**.
- A bundled GeoJSON snapshot of all 78 municipio boundaries, from the Census 2025 cartographic boundary file (1:500,000), downloaded November 5, 2026 and converted to GeoJSON. Provenance is in `data/municipalities-provenance.json`. The snapshot is for map context, not parcel boundaries, legal surveys or authoritative acreage.
- Wetlands, watersheds, hydrography, water wells, aquifers, impaired waters, flood/advisory zones, tsunami and landslide susceptibility, coastal erosion/scenarios, habitat, zoning, soils, geology, EPA facilities, Census geography, roads, hospitals, airports and schools.
- USGS earthquakes from the past seven days, filtered locally to 16–21°N and 69–63°W, including the Puerto Rico region and neighboring waters. This is a service request snapshot; turn it off and on to refresh.
- Provider map services refresh their map image when you pan or zoom. “Live service” means an online connection, **not necessarily real-time or recently revised underlying data**. Publisher vintages vary; some Census layers explicitly use 2020 geography.
- Live ArcGIS service/folder discovery, selected-layer connection, and custom ArcGIS map/feature, WMS, XYZ and GeoJSON sources.
- Local GeoJSON, KML, GPX, CSV point and zipped Shapefile imports, saved in IndexedDB on this browser and origin.
- Rule-based English/Spanish map assistant, municipality/coordinate search, point inspection, distance and area measurement, source legends, layer opacity, saved sources, shareable view links, workspace export/import and browser printing.

## Working with data

1. **Explore:** Search the layer catalog or choose a topic, then toggle a layer. Use the details button for the publisher, URL, terms, description and metadata.
2. **Find places:** Search any municipio, or enter latitude, longitude, e.g. `18.472, -66.267`. This is not a street-address geocoder.
3. **Inspect:** Local vector features open attributes when clicked. The crosshair tool queries active ArcGIS MapServers at a point; layer visibility scales and record limits still apply. WMS and XYZ are display layers, not feature-query layers.
4. **Measure:** Choose distance or area, click vertices, and double-click or press Done. Measurements use geodesic distance and spherical area approximations; do not use them as survey-grade measurements. Workspace export preserves the most recent measurement geometry.
5. **Assistant:** Enter “Show wetlands in Hatillo” or “Calidad de agua en Camuy.” Topic and municipality matching suggests sources and moves the map. You choose which layers to activate. The assistant does not use an LLM, send prompts to an external provider, or produce regulatory conclusions.
6. **Offline snapshots:** Open a map layer’s details and choose Save visible features for offline use. Query-capable ArcGIS layers are copied only for the current map extent, with up to 5,000 records per sublayer (maximum four sublayers per request). The local layer keeps the original provider, terms, timestamp, extent and partial-result flags. Raster-only sources cannot be saved this way.
7. **My data:** Import a file up to 20 MB. GeoJSON coordinates must be WGS84 longitude/latitude. CSV column headings should be latitude/longitude (lat/lon, lng, x/y also accepted). Invalid CSV coordinate rows are explicitly skipped. Shapefile ZIPs should include .shp, .shx, .dbf and .prj. GPX/KML are converted locally. Styling, embedded images, and all specialized format extensions may not survive conversion.
8. **Save:** Export a workspace JSON to back up imported data and source connections. Browser storage is not server storage and can be cleared or evicted. Workspace import supports up to 50 MB. Sharing a view URL does not share local datasets or custom endpoints.

For large rasters, LiDAR, GeoPackage, GeoTIFF, NetCDF or full-island OSM databases, preprocess the data with QGIS/GDAL or a suitable data tool. Serve derived tiles or publish a WMS/ArcGIS service, then connect it. This browser application does not ingest every geospatial format or bundle these large archives.

## Offline behavior

The application, dependencies and municipality snapshot are local files. On HTTPS, the service worker stores only this application shell and its bundled data after a successful visit. Choose the Offline basemap for island/municipal geometry. Imported data is stored locally with IndexedDB.

No external basemap tiles, agency rasters, remote feature datasets, or entire catalogs are bulk-downloaded or made available offline automatically. OpenStreetMap's public tile service prohibits bulk/offline tile downloading. For detailed offline basemaps, create or obtain a properly licensed tile set and serve it from `tiles/{z}/{x}/{y}.png`; add that URL as a custom XYZ layer. Keep its attribution and source license. A copy on a shared hosting server still needs connectivity to that server unless the user has a local server/copy.

On HTTP localhost the bundled files and imports work, but this release registers its service worker only on HTTPS. The Offline button selects bundled vector context; it does not disconnect the network.

## Add or maintain sources

Edit `data/catalog.json`, or use Connect a map service in the interface. Catalog entries use this schema:

```json
{
  "id": "unique-layer-id",
  "name": "Descriptive layer title",
  "provider": "Publishing agency",
  "category": "Water & wetlands",
  "kind": "arcgis",
  "url": "https://agency.example/arcgis/rest/services/MyService/MapServer",
  "layers": "0",
  "description": "Coverage, vintage, limitations and intended use.",
  "license": "Publisher terms and link; do not assume an open license",
  "status": "User-added; unverified",
  "sourceUrl": "https://agency.example/data",
  "color": "#2387ad"
}
```

Supported kinds: `local` (relative bundled GeoJSON), `geojson`, `arcgis` (MapServer root plus comma-separated sublayer IDs), `feature` (MapServer/FeatureServer numeric layer URL), `wms` (1.1.1, EPSG:3857 support required), `xyz`, and `portal` (publisher link). A portal is not a rendered map layer. Browsing an agency directory does not automatically import all its services.

FeatureServer snapshots query only the current visible extent, up to five pages of 1,000 records. Servers may impose smaller limits or lack pagination/GeoJSON/CORS support; results can be incomplete. Re-add the layer to refresh for another extent. Avoid treating this as a full data export. MapServer display layers use images and have publisher-dependent maximum scales, coverage and uptime.

To add another agency, edit `data/providers.json`. Record its exact verified REST service root or official discovery URL. Keep IDs unique. When changing bundled files, increment the cache name in `sw.js` so returning browsers can retire an old cache. The worker uses network-first requests for bundled resources when online.

## Licensing and source reliability

The initial catalog was researched on November 5, 2026. “Verified metadata” describes a metadata inspection, not a guaranteed live render, per-feature Puerto Rico coverage check, current regulatory status or legal license review. “Intermittent” flags observed connection problems or uncertainty. Errors and scale-dependent blank maps must not be interpreted as absence of hazards or regulated features.

Federal, Puerto Rico, community and commercial basemap sources have different terms. Government access alone does not establish unrestricted reuse. Basemap imagery is not part of the MIT software license. Retain source attribution and verify licensing before redistribution, bulk extraction or commercial hosting. Some public data may include third-party material. Publisher imagery and services are not redistributed in this ZIP.

Useful official references:

- [Census TIGERweb](https://tigerweb.geo.census.gov/tigerwebmain/TIGERweb_restmapservice.html)
- [Puerto Rico JP GIS hub](https://sistema-de-informacion-geografica-junta-de-planificacion-gisjp.hub.arcgis.com/)
- [USGS National Map](https://www.usgs.gov/programs/national-geospatial-program/national-map)
- [USFWS Wetlands Mapper](https://www.fws.gov/program/national-wetlands-inventory/wetlands-mapper)
- [NOAA Digital Coast](https://coast.noaa.gov/digitalcoast/)
- [EPA NEPAssist](https://www.epa.gov/nepa/nepassist)
- [OpenStreetMap tile policy](https://operations.osmfoundation.org/policies/tiles/)
- [Esri imagery attributions](https://www.esri.com/en-us/legal/terms/data-attributions)

## Privacy and operational limits

There is no analytics, account system, external AI, server-side upload or open proxy in this application. Map providers receive routine browser requests, IP address, viewed extents, and identifying point-query coordinates. The optional location button requests browser permission. Do not assume that a live map interaction is private from the chosen provider.

Imported files, saved sources and workspaces remain on the browser unless you export and share them. A workspace export contains the full imported datasets and custom URLs; review it before distributing it. Do not embed credentials in custom URLs or in published catalog files. Static hosting does not provide access control to files you upload.

This release is a data exploration and preliminary screening tool. Confirm authoritative sources for floodplain decisions, wetland jurisdiction, permitting, title/parcel questions, engineering design and emergency action. The site is independent and not an official agency system.
