| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
This project provides a simple utility to generate SQL (or other format) queries from a JSON resource file containing region data.
mvn clean compile exec:java -Dexec.mainClass="Main"The input JSON file must be located at src/main/java/resources/region.json
Example Input:
{
"geometries": [
{
"type": "Polygon",
"properties": {
"name": "Los Angeles",
"zip": "90001",
"state": "CA"
},
"arcs": "[[78179, 78180, 78181, 78182, 78183, 78184]]"
},
{
"type": "Polygon",
"properties": {
"name": "San Diego",
"zip": "92101",
"state": "CA"
},
"arcs": "[[79255, 79256, 79257, 79258, 79259, 79260, 79261]]"
}]
}
When executed, the program generates the SQL file in a platform-specific directory:
Example Output:
INSERT INTO map.geometry (geometryType, regionName, zipCode, stateCode, arcs, idstatefk) VALUES
('Polygon','LOS ANGELES',90001,'CA','[[78179, 78180, 78181, 78182, 78183, 78184]]',5),
('Polygon','SAN DIEGO',92101,'CA','[[79255, 79256, 79257, 79258, 79259, 79260, 79261]]',5);
The SQL file generated by this project can be directly used to populate the database in the OpenStreetMap Services project. This allows seamless integration of the data into the backend services.
| Back | FazBrowse Home | New Git URL |