├── .devcontainer ├── devcontainer.json └── postcreate.sh ├── .dockerignore ├── .gitattributes ├── .gitignore ├── KEYS ├── README.md ├── buildSrc ├── build.gradle ├── settings.gradle └── src │ ├── main │ ├── groovy │ │ ├── geoclient.java-conventions.gradle │ │ ├── geoclient.library-conventions.gradle │ │ └── geoclient.test-conventions.gradle │ ├── java │ │ └── geoclientbuild │ │ │ ├── docs │ │ │ ├── DefaultHttpClientManager.java │ │ │ ├── DocumentationPlugin.java │ │ │ ├── Endpoint.java │ │ │ ├── Endpoints.java │ │ │ ├── GenerateSamplesTask.java │ │ │ ├── HttpClientManager.java │ │ │ ├── Request.java │ │ │ └── RestClient.java │ │ │ └── runner │ │ │ ├── ServiceRunner.java │ │ │ └── ServiceRunnerTask.java │ └── resources │ │ └── requests.json │ └── test │ └── java │ └── geoclientbuild │ └── docs │ └── GenerateSamplesTaskTest.java ├── ci ├── Dockerfile └── azure-pipelines.yml ├── documentation ├── build.gradle └── src │ ├── docs │ └── asciidoc │ │ ├── attributes.adoc │ │ ├── docinfo.html │ │ ├── images │ │ └── geoclient-runtime.png │ │ ├── index.adoc │ │ ├── legacy │ │ ├── build.adoc │ │ ├── devportal.adoc │ │ ├── generated.adoc │ │ ├── geosupport.adoc │ │ ├── native.adoc │ │ └── project-readme.adoc │ │ ├── parts │ │ ├── code-samples.adoc │ │ ├── concepts.adoc │ │ ├── development.adoc │ │ ├── geosupport-docs.adoc │ │ ├── history.adoc │ │ ├── presentations.adoc │ │ ├── release-notes.adoc │ │ └── rest-service.adoc │ │ └── samples │ │ ├── address-1.jsonc │ │ ├── addresspoint-1.jsonc │ │ ├── bbl-1.jsonc │ │ ├── bin-1.jsonc │ │ ├── blockface-1.jsonc │ │ ├── intersection-1.jsonc │ │ ├── search-1.jsonc │ │ └── version-1.jsonc │ ├── integrationTest │ ├── java │ │ └── gov │ │ │ └── nyc │ │ │ └── doitt │ │ │ └── gis │ │ │ └── geoclient │ │ │ └── docs │ │ │ ├── GeneratorServiceIntegrationTests.java │ │ │ ├── SampleAggregator.java │ │ │ ├── SampleGeneratorApplicationTests.java │ │ │ └── ServiceClientIntegrationTests.java │ └── resources │ │ ├── address.csv │ │ ├── addresspoint.csv │ │ ├── application.yml │ │ ├── bbl.csv │ │ ├── bin.csv │ │ ├── blockface.csv │ │ ├── intersection.csv │ │ ├── search.csv │ │ └── version.csv │ ├── main │ ├── java │ │ └── gov │ │ │ └── nyc │ │ │ └── doitt │ │ │ └── gis │ │ │ └── geoclient │ │ │ └── docs │ │ │ ├── Configuration.java │ │ │ ├── DocumentationException.java │ │ │ ├── ExternalProperties.java │ │ │ ├── GeneratorService.java │ │ │ ├── PathVariable.java │ │ │ ├── Response.java │ │ │ ├── ResponseWriter.java │ │ │ ├── Sample.java │ │ │ ├── SampleGeneratorApplication.java │ │ │ ├── ServiceClient.java │ │ │ └── package-info.java │ └── resources │ │ └── application.yml │ └── test │ └── java │ └── gov │ └── nyc │ └── doitt │ └── gis │ └── geoclient │ └── docs │ └── GeneratorPropertiesTests.java ├── geoclient-core ├── build.gradle ├── doc │ ├── function-api.png │ └── function-call-sequence.png ├── etc │ ├── fhr.txt │ ├── wa2_apx.xml │ └── workareas.xlsx └── src │ ├── integrationTest │ └── java │ │ └── gov │ │ └── nyc │ │ └── doitt │ │ └── gis │ │ └── geoclient │ │ ├── api │ │ └── GeoclientCoreIntegrationTest.java │ │ └── config │ │ ├── GeosupportConfigIntegrationTest.java │ │ └── xml │ │ └── GeoclientXmlReaderIntegrationTest.java │ ├── main │ ├── java │ │ └── gov │ │ │ └── nyc │ │ │ └── doitt │ │ │ └── gis │ │ │ └── geoclient │ │ │ ├── api │ │ │ ├── Borough.java │ │ │ ├── Boroughs.java │ │ │ ├── CallBuilder.java │ │ │ ├── CodeNamedValue.java │ │ │ ├── Coded.java │ │ │ ├── InputParam.java │ │ │ ├── InvalidStreetCodeException.java │ │ │ ├── Named.java │ │ │ ├── OutputParam.java │ │ │ ├── Response.java │ │ │ ├── ReturnCodeValue.java │ │ │ ├── Street.java │ │ │ ├── StreetCode.java │ │ │ ├── StreetCodeType.java │ │ │ └── package-info.java │ │ │ ├── cli │ │ │ ├── GeosupportClient.java │ │ │ └── package-info.java │ │ │ ├── config │ │ │ ├── ConfigurationException.java │ │ │ ├── FunctionConfig.java │ │ │ ├── GeosupportConfig.java │ │ │ ├── InvalidWorkAreaLengthException.java │ │ │ ├── Registry.java │ │ │ ├── UnknownFunctionException.java │ │ │ ├── WorkAreaConfig.java │ │ │ ├── package-info.java │ │ │ └── xml │ │ │ │ ├── ConfigurationConverter.java │ │ │ │ ├── FieldConverter.java │ │ │ │ ├── GeoclientXmlReader.java │ │ │ │ ├── XStreamBuilder.java │ │ │ │ ├── XmlConfigurationException.java │ │ │ │ └── package-info.java │ │ │ ├── function │ │ │ ├── Configuration.java │ │ │ ├── DefaultConfiguration.java │ │ │ ├── Field.java │ │ │ ├── Filter.java │ │ │ ├── Function.java │ │ │ ├── GeosupportFunction.java │ │ │ ├── WorkArea.java │ │ │ └── package-info.java │ │ │ └── util │ │ │ ├── Assert.java │ │ │ ├── ByteBufferUtils.java │ │ │ ├── ClassUtils.java │ │ │ ├── OperatingSystemUtils.java │ │ │ ├── StringUtils.java │ │ │ └── package-info.java │ ├── python │ │ ├── gen-fn1a-geographic-ids.py │ │ ├── gen-fn1ax-geographic-ids.py │ │ ├── gen-fn1b-geographic-ids.py │ │ ├── gen-fnap-geographic-ids.py │ │ └── gen-fnapx-geographic-ids.py │ ├── resources │ │ └── geoclient.xml │ └── ruby │ │ └── field.rb │ └── test │ ├── java │ └── gov │ │ └── nyc │ │ └── doitt │ │ └── gis │ │ └── geoclient │ │ ├── api │ │ ├── BoroughsTest.java │ │ ├── CallBuilderTest.java │ │ └── StreetCodeTypeTest.java │ │ ├── config │ │ ├── FunctionConfigTest.java │ │ ├── FunctionToCsv.java │ │ ├── RegistryTest.java │ │ ├── TestData.java │ │ ├── WorkAreaConfigTest.java │ │ └── xml │ │ │ ├── ConfigurationConverterTest.java │ │ │ └── FieldConverterTest.java │ │ ├── function │ │ ├── FieldTest.java │ │ ├── FilterTest.java │ │ ├── GeosupportConfigurationTest.java │ │ ├── GeosupportFunctionTest.java │ │ └── WorkAreaTest.java │ │ ├── test │ │ └── Fixtures.java │ │ └── util │ │ ├── ByteBufferUtilsTest.java │ │ ├── ClassUtilsTest.java │ │ └── OperatingSystemUtilsTest.java │ └── resources │ ├── duplicate_field.properties │ └── logback-test.xml ├── geoclient-jni ├── CHANGES.txt ├── README.txt ├── build.gradle ├── dist │ └── v1.0.10 │ │ ├── linux-x86_64 │ │ ├── ctest │ │ └── libGeoclientImpl_JNI.so │ │ └── mingw32-i686 │ │ ├── GeoclientImpl_JNI.dll │ │ └── ctest.exe ├── lib │ └── geosupport │ │ └── headers │ │ ├── GLUEGEN_NEEDS_GEO_H_IN_WINDOWS_INCLUDE.txt │ │ ├── NYCgeo.h │ │ ├── geo.h │ │ ├── geo.h.orig │ │ ├── geo_h.patch │ │ ├── pac.h │ │ └── wa_fields.h └── src │ ├── integrationTest │ └── java │ │ └── gov │ │ └── nyc │ │ └── doitt │ │ └── gis │ │ └── geoclient │ │ └── jni │ │ └── GeoclientJniIntegrationTest.java │ ├── main │ ├── c │ │ ├── GeoclientJni_JNI.c │ │ └── geoclient.c │ ├── headers │ │ └── geoclient.h │ └── java │ │ └── gov │ │ └── nyc │ │ └── doitt │ │ └── gis │ │ └── geoclient │ │ └── jni │ │ ├── Geoclient.java │ │ ├── GeoclientJni.java │ │ ├── JniContext.java │ │ ├── NativeLibraryLoader.java │ │ ├── package-info.java │ │ └── util │ │ ├── JniLibrary.java │ │ ├── JniLibraryException.java │ │ ├── NativeLibraryLocator.java │ │ ├── Platform.java │ │ ├── UnsupportedPlatformException.java │ │ └── package-info.java │ ├── test │ ├── c │ │ └── geoclient_test.c │ ├── java │ │ └── gov │ │ │ └── nyc │ │ │ └── doitt │ │ │ └── gis │ │ │ └── geoclient │ │ │ └── jni │ │ │ └── util │ │ │ ├── JniLibraryExceptionTest.java │ │ │ ├── JniLibraryTest.java │ │ │ ├── NativeLibraryLocatorTest.java │ │ │ └── PlatformTest.java │ └── resources │ │ └── logback-test.xml │ └── testFixtures │ └── java │ └── gov │ └── nyc │ └── doitt │ └── gis │ └── geoclient │ └── jni │ └── test │ └── GeoclientStub.java ├── geoclient-parser ├── build.gradle ├── etc │ ├── address-data.csv │ ├── city.txt │ ├── neighborhood.txt │ └── zip.txt └── src │ ├── main │ ├── java │ │ └── gov │ │ │ └── nyc │ │ │ └── doitt │ │ │ └── gis │ │ │ └── geoclient │ │ │ └── parser │ │ │ ├── Input.java │ │ │ ├── LocationTokenizer.java │ │ │ ├── LocationTokens.java │ │ │ ├── ParseContext.java │ │ │ ├── Parser.java │ │ │ ├── SingleFieldSearchParser.java │ │ │ ├── configuration │ │ │ ├── ParserConfig.java │ │ │ └── package-info.java │ │ │ ├── package-info.java │ │ │ ├── regex │ │ │ ├── AbstractRegexParser.java │ │ │ ├── AddressParser.java │ │ │ ├── BblParser.java │ │ │ ├── BinParser.java │ │ │ ├── BlockfaceParser.java │ │ │ ├── BoroughParser.java │ │ │ ├── CityParser.java │ │ │ ├── CountryParser.java │ │ │ ├── IntersectionParser.java │ │ │ ├── Match.java │ │ │ ├── MatchBuilder.java │ │ │ ├── MatchType.java │ │ │ ├── ParseStatus.java │ │ │ ├── PatternUtils.java │ │ │ ├── RegexTokenGroup.java │ │ │ ├── UnrecognizedTextParser.java │ │ │ ├── ZipParser.java │ │ │ └── package-info.java │ │ │ ├── test │ │ │ ├── ChunkSpec.java │ │ │ ├── ChunkSpecParser.java │ │ │ ├── TestConfigurationException.java │ │ │ └── package-info.java │ │ │ ├── token │ │ │ ├── Chunk.java │ │ │ ├── ChunkType.java │ │ │ ├── Token.java │ │ │ ├── TokenType.java │ │ │ └── package-info.java │ │ │ └── util │ │ │ ├── Assert.java │ │ │ ├── TextUtils.java │ │ │ └── package-info.java │ └── resources │ │ ├── borough-names.properties │ │ ├── city-names.properties │ │ ├── regexDataContext.xml │ │ └── zip.properties │ └── test │ ├── java │ └── gov │ │ └── nyc │ │ └── doitt │ │ └── gis │ │ └── geoclient │ │ └── parser │ │ ├── AbstractSpecTest.java │ │ ├── InputTest.java │ │ ├── LocationTokensTest.java │ │ ├── SingleFieldSearchParserTest.java │ │ ├── configuration │ │ └── PatternDataTest.java │ │ ├── regex │ │ ├── AddressParserTest.java │ │ ├── BblParserTest.java │ │ ├── BinParserTest.java │ │ ├── BlockfaceParserTest.java │ │ ├── BoroughParserTest.java │ │ ├── CityParserTest.java │ │ ├── CountryParserTest.java │ │ ├── IntersectionParserTest.java │ │ ├── PatternUtilsTest.java │ │ ├── RegexSandboxTest.java │ │ └── ZipParserTest.java │ │ ├── test │ │ ├── ChunkSpecParserTest.java │ │ ├── SpecBuilder.java │ │ ├── UnparsedSpec.java │ │ └── UnparsedSpecs.java │ │ └── util │ │ ├── AssertTest.java │ │ └── TextUtilsTest.java │ └── resources │ └── specs.xml ├── geoclient-service ├── build.gradle ├── doc │ ├── deployment-landscape.png │ └── deployment-portrait.png ├── etc │ ├── generated-doc.md │ ├── generated-rc.html │ └── response │ │ └── v1 │ │ └── 2019 │ │ └── 03 │ │ ├── address.json │ │ ├── blockface.json │ │ ├── intersection.json │ │ └── search.json └── src │ ├── integrationTest │ └── java │ │ └── gov │ │ └── nyc │ │ └── doitt │ │ └── gis │ │ └── geoclient │ │ └── service │ │ ├── search │ │ ├── SingleFieldSearchHandlerTest.java │ │ └── web │ │ │ ├── SingleFieldSearchControllerIntegrationTest.java │ │ │ └── SingleFieldSearchControllerMvcIntegrationTest.java │ │ ├── test │ │ └── WebContainerIntegrationTest.java │ │ └── web │ │ ├── DocumentationControllerIntegrationTest.java │ │ ├── RestControllerIntegrationTest.java │ │ └── VersionIntegrationTest.java │ ├── main │ ├── java │ │ └── gov │ │ │ └── nyc │ │ │ └── doitt │ │ │ └── gis │ │ │ └── geoclient │ │ │ └── service │ │ │ ├── GeoclientBootApplication.java │ │ │ ├── configuration │ │ │ ├── AppConfig.java │ │ │ ├── Profiles.java │ │ │ ├── ThymeleafConfig.java │ │ │ ├── WebConfig.java │ │ │ └── package-info.java │ │ │ ├── domain │ │ │ ├── BadRequest.java │ │ │ ├── BaseFileInfo.java │ │ │ ├── FieldSet.java │ │ │ ├── FileInfo.java │ │ │ ├── GeosupportVersion.java │ │ │ ├── ServiceType.java │ │ │ ├── StreetNameFormat.java │ │ │ ├── ThinFileInfo.java │ │ │ ├── Version.java │ │ │ └── package-info.java │ │ │ ├── invoker │ │ │ ├── DoubleFieldSetConverter.java │ │ │ ├── FieldSetConverter.java │ │ │ ├── GeosupportService.java │ │ │ ├── GeosupportServiceImpl.java │ │ │ └── package-info.java │ │ │ ├── mapper │ │ │ ├── AbstractParameterMapper.java │ │ │ ├── GeosupportVersionMapper.java │ │ │ ├── Mapper.java │ │ │ ├── MappingContext.java │ │ │ ├── MappingException.java │ │ │ ├── ResponseStatusMapper.java │ │ │ └── package-info.java │ │ │ ├── package-info.java │ │ │ ├── sanitizer │ │ │ ├── SanitizeParametersFilter.java │ │ │ ├── SanitizeParametersRequestWrapper.java │ │ │ └── package-info.java │ │ │ ├── search │ │ │ ├── CountyResolver.java │ │ │ ├── GeosupportReturnCode.java │ │ │ ├── InputValue.java │ │ │ ├── Response.java │ │ │ ├── ResponseStatus.java │ │ │ ├── Search.java │ │ │ ├── SearchId.java │ │ │ ├── SearchResult.java │ │ │ ├── SingleFieldSearchHandler.java │ │ │ ├── ValueResolution.java │ │ │ ├── ValueSource.java │ │ │ ├── package-info.java │ │ │ ├── policy │ │ │ │ ├── AbstractPolicy.java │ │ │ │ ├── DefaultExactMatchPolicy.java │ │ │ │ ├── DefaultSearchDepthPolicy.java │ │ │ │ ├── DefaultSimilarNamesPolicy.java │ │ │ │ ├── ExactMatchPolicy.java │ │ │ │ ├── Policy.java │ │ │ │ ├── SearchDepthPolicy.java │ │ │ │ ├── SearchPolicy.java │ │ │ │ ├── SimilarNamesPolicy.java │ │ │ │ └── package-info.java │ │ │ ├── request │ │ │ │ ├── AddressRequest.java │ │ │ │ ├── BblRequest.java │ │ │ │ ├── BinRequest.java │ │ │ │ ├── BlockfaceRequest.java │ │ │ │ ├── CountyRequest.java │ │ │ │ ├── IntersectionRequest.java │ │ │ │ ├── PlaceRequest.java │ │ │ │ ├── Request.java │ │ │ │ ├── RequestUtils.java │ │ │ │ └── package-info.java │ │ │ ├── task │ │ │ │ ├── AddressSearchTask.java │ │ │ │ ├── BblSearchTask.java │ │ │ │ ├── BinSearchTask.java │ │ │ │ ├── BlockfaceSearchTask.java │ │ │ │ ├── CompassDirectionTaskBuilder.java │ │ │ │ ├── DefaultInitialSearchTaskBuilder.java │ │ │ │ ├── DefaultSpawnedTaskBuilder.java │ │ │ │ ├── InitialSearchTaskBuilder.java │ │ │ │ ├── IntersectionSearchTask.java │ │ │ │ ├── PlaceSearchTask.java │ │ │ │ ├── SearchTask.java │ │ │ │ ├── SearchTaskFactory.java │ │ │ │ ├── SimilarNamesTaskBuilder.java │ │ │ │ ├── SpawnedSearchTaskBuilder.java │ │ │ │ ├── TaskBuilderSupport.java │ │ │ │ └── package-info.java │ │ │ └── web │ │ │ │ ├── SingleFieldSearchController.java │ │ │ │ ├── package-info.java │ │ │ │ └── response │ │ │ │ ├── MatchStatus.java │ │ │ │ ├── ParamsAndResult.java │ │ │ │ ├── ParseTree.java │ │ │ │ ├── PolicySummary.java │ │ │ │ ├── SearchParameters.java │ │ │ │ ├── SearchResponse.java │ │ │ │ ├── SearchResultConverter.java │ │ │ │ ├── SearchSummary.java │ │ │ │ ├── Status.java │ │ │ │ └── package-info.java │ │ │ ├── street │ │ │ └── web │ │ │ │ ├── StreetCodeController.java │ │ │ │ ├── StreetCodeConverter.java │ │ │ │ ├── StreetCodeRequest.java │ │ │ │ └── package-info.java │ │ │ ├── web │ │ │ ├── ApiOriginFilter.java │ │ │ ├── DocumentationController.java │ │ │ ├── MissingAnyOfOptionalServletRequestParametersException.java │ │ │ ├── RestController.java │ │ │ ├── ViewHelper.java │ │ │ └── package-info.java │ │ │ └── xstream │ │ │ ├── MapConverter.java │ │ │ └── package-info.java │ └── resources │ │ ├── application.yml │ │ ├── banner.txt │ │ ├── static │ │ ├── api │ │ │ ├── api-docs.json │ │ │ └── openapi.yml │ │ ├── css │ │ │ └── style.css │ │ ├── images │ │ │ ├── arrow-down.png │ │ │ ├── new.jpg │ │ │ └── octocat-small.png │ │ └── js │ │ │ ├── jquery-1.10.1.js │ │ │ └── scale.fix.js │ │ └── templates │ │ └── index.html │ └── test │ ├── java │ └── gov │ │ └── nyc │ │ └── doitt │ │ └── gis │ │ └── geoclient │ │ └── service │ │ ├── configuration │ │ └── ProfilesTest.java │ │ ├── domain │ │ ├── FieldSetTest.java │ │ ├── FileInfoTest.java │ │ └── GeosupportVersionTest.java │ │ ├── invoker │ │ ├── AbstractMockInvokerTests.java │ │ ├── DoubleFieldSetConverterTest.java │ │ └── GeosupportServiceImplTest.java │ │ ├── mapper │ │ ├── Cat.java │ │ ├── CatMapper.java │ │ ├── Dog.java │ │ ├── DogMapper.java │ │ ├── GeosupportReturnCodeFixture.java │ │ ├── GeosupportVersionMapperTest.java │ │ ├── MapWrapper.java │ │ ├── MappingContextTest.java │ │ ├── ResponseStatusMapperTest.java │ │ └── ReturnCodeData.java │ │ ├── sanitizer │ │ └── SanitizeParametersRequestWrapperTest.java │ │ ├── search │ │ ├── CountyResolverTest.java │ │ ├── Fixtures.java │ │ ├── GeosupportReturnCodeTest.java │ │ ├── InputValueTest.java │ │ ├── ResponseStatusTest.java │ │ ├── ResponseTest.java │ │ ├── SearchIdTest.java │ │ ├── SearchTest.java │ │ ├── ValueResolutionTest.java │ │ ├── policy │ │ │ ├── DefaultExactMatchPolicyTest.java │ │ │ ├── DefaultSearchDepthPolicyTest.java │ │ │ ├── DefaultSimilarNamesPolicyTest.java │ │ │ └── SearchPolicyTest.java │ │ ├── request │ │ │ ├── BlockfaceRequestTest.java │ │ │ └── PlaceRequestTest.java │ │ ├── task │ │ │ └── SearchTaskFactoryTest.java │ │ └── web │ │ │ └── response │ │ │ └── SearchParametersTest.java │ │ ├── web │ │ ├── DocumentationControllerTest.java │ │ ├── RestControllerTest.java │ │ └── ViewHelperTest.java │ │ └── xstream │ │ └── MapConverterTest.java │ └── resources │ └── logback-test.xml ├── geoclient-test ├── build.gradle └── src │ ├── data │ ├── address.csv │ └── geosupport-18d_18.4.csv │ ├── main │ └── java │ │ └── gov │ │ └── nyc │ │ └── doitt │ │ └── gis │ │ └── geoclient │ │ └── test │ │ ├── GeosupportIntegrationTest.java │ │ ├── IntegrationTestSupport.java │ │ ├── LogLevelAdapter.java │ │ ├── NativeIntegrationTest.java │ │ ├── RequiresRestServiceCustomCondtion.java │ │ └── package-info.java │ └── test │ └── java │ └── gov │ └── nyc │ └── doitt │ └── gis │ └── geoclient │ └── test │ ├── IntegrationTestSupportTest.java │ └── RequiresRestServiceCustomConditionTest.java ├── geoclient-utils ├── cli │ ├── build.gradle │ └── src │ │ └── main │ │ └── java │ │ └── gov │ │ └── nyc │ │ └── doitt │ │ └── gis │ │ └── geoclient │ │ └── cli │ │ ├── JniTest.java │ │ └── package-info.java └── jni-test │ ├── build.gradle │ └── src │ └── main │ ├── java │ └── gov │ │ └── nyc │ │ └── doitt │ │ └── gis │ │ └── geoclient │ │ └── jni │ │ └── test │ │ ├── ByteBufferUtils.java │ │ ├── ConfigInitializer.java │ │ ├── TestConfig.java │ │ ├── TestConfigurationException.java │ │ ├── TestFileParser.java │ │ └── package-info.java │ └── resources │ └── jni-test.conf ├── gradle.properties ├── gradle ├── config │ ├── checkstyle │ │ ├── checkstyle.xml │ │ └── suppressions.xml │ ├── eclipse │ │ ├── geoclient-eclipse-formatter-settings.xml │ │ └── geoclient-eclipse.importorder │ └── spotless │ │ └── apache-license-2.0.java ├── libs.versions.toml └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── images ├── .env ├── README.md ├── build.Dockerfile ├── compose.yaml ├── run.Dockerfile ├── run.Dockerfile.dockerignore └── run.sh ├── manifests ├── base │ ├── properties │ │ ├── kustomization.yaml │ │ └── pipeline.env │ └── resources │ │ ├── deployment.yaml │ │ ├── hpa.yaml │ │ ├── kustomization.yaml │ │ ├── pipeline.env │ │ ├── replacement.yaml │ │ ├── runtime.env │ │ └── service.yaml ├── build.sh ├── cluster-state.sh ├── compare.sh ├── components │ ├── development │ │ ├── kustomization.yaml │ │ ├── pipeline.env │ │ └── replacement.yaml │ ├── minikube │ │ ├── kustomization.yaml │ │ ├── pipeline.env │ │ └── replacement.yaml │ ├── production │ │ ├── ingress-patch.yaml │ │ ├── kustomization.yaml │ │ ├── pipeline.env │ │ └── replacement.yaml │ ├── pvc-azurefile │ │ ├── kustomization.yaml │ │ ├── patch.yaml │ │ ├── pvc.yaml │ │ └── replacement.yaml │ └── pvc-hostpath │ │ ├── kustomization.yaml │ │ ├── patch.yaml │ │ ├── pvc.yaml │ │ └── replacement.yaml ├── kustomize.md └── overlays │ ├── app │ ├── dev │ │ ├── no-pvc │ │ │ └── kustomization.yaml │ │ └── pvc │ │ │ └── kustomization.yaml │ ├── minikube │ │ ├── base │ │ │ ├── kustomization.yaml │ │ │ └── replacement.yaml │ │ ├── no-pvc │ │ │ └── kustomization.yaml │ │ └── pvc │ │ │ └── kustomization.yaml │ └── prd │ │ ├── no-pvc │ │ └── kustomization.yaml │ │ └── pvc │ │ └── kustomization.yaml │ ├── ingress-nginx │ ├── base │ │ ├── ingress.yaml │ │ └── kustomization.yaml │ ├── dev │ │ ├── kustomization.yaml │ │ └── replacement.yaml │ └── prd │ │ ├── kustomization.yaml │ │ └── replacement.yaml │ ├── pvc-azurefile │ ├── base │ │ ├── kustomization.yaml │ │ └── pvc.yaml │ ├── dev │ │ ├── kustomization.yaml │ │ └── replacement.yaml │ └── prd │ │ ├── kustomization.yaml │ │ └── replacement.yaml │ └── pvc-hostpath │ ├── kustomization.yaml │ ├── pvc.yaml │ └── replacement.yaml ├── settings.gradle └── src ├── dist ├── license.txt └── notice.txt ├── doc ├── BUILD.md ├── INSTALL-GEOSUPPORT.md ├── examples │ ├── simple-js │ │ ├── README.md │ │ ├── build.gradle │ │ ├── gradle.properties │ │ ├── gradle │ │ │ └── wrapper │ │ │ │ ├── gradle-wrapper.jar │ │ │ │ └── gradle-wrapper.properties │ │ ├── gradlew │ │ ├── gradlew.bat │ │ ├── settings.gradle │ │ └── src │ │ │ └── main │ │ │ └── webapp │ │ │ ├── index.html │ │ │ └── js │ │ │ └── geocode.js │ └── src-build-setup │ │ └── gcenv.sh ├── geoclient-native.md ├── geoclient-runtime.png ├── nyc-developer-portal │ └── service-usage-guidelines.md └── presentations │ ├── BetaNYC-nyc-doitt-geoclient.pdf │ ├── Code4LibNYC-geoclient-links.html │ ├── Code4LibNYC-geoclient-overview.pdf │ ├── geoclient-why-bother.pdf │ └── nyc-geoclient-api.pdf └── scripts ├── gen-package-info.sh └── packages.txt /.devcontainer/postcreate.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | add_cmds=$(cat <> "${HOME}/.bashrc" 14 | fi 15 | 16 | #export GCBASE="/workspaces/geoclient" 17 | #export GCJNI="${GCBASE}/geoclient-jni" 18 | #export GCCORE="${GCBASE}/geoclient-core" 19 | #export GCPARSER="${GCBASE}/geoclient-parser" 20 | #export GCSERVICE="${GCBASE}/geoclient-service" 21 | 22 | /opt/geosupport/current/bin/geosupport install 23 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | **/.DS_Store 2 | **/.dockerignore 3 | # **/.env 4 | # **/.git 5 | # **/.gitignore 6 | **/.gradle 7 | **/.local 8 | # **/.vscode 9 | **/bin 10 | **/build 11 | **/images 12 | **/docker-compose* 13 | **/compose* 14 | **/Dockerfile* 15 | **/*Dockerfile* 16 | **/secrets.dev.yaml 17 | **/values.dev.yaml -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto eol=lf 2 | *.{cmd,[cC][mM][dD]} text eol=crlf 3 | *.{bat,[bB][aA][tT]} text eol=crlf 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Intellij 2 | **/*.iml 3 | **/*.ipr 4 | **/*.iws 5 | **/.idea 6 | **/*.eml 7 | 8 | # Eclipse 9 | **/.classpath 10 | **/.project 11 | **/.settings/ 12 | **/.springBeans 13 | **/bin/ 14 | **/.sts4-cache/ 15 | 16 | # VisualStudio 17 | **/.vs 18 | **/vs/ 19 | **/.vscode/ 20 | 21 | # Vim 22 | **/*.swp 23 | 24 | # Gradle & other common build artifacts 25 | **/build 26 | **/target 27 | **/out 28 | **/.gradle 29 | **/classes 30 | **/.gradletasknamecache 31 | 32 | **/*.log 33 | 34 | # Local native development artifacts 35 | #**/geoclient-test 36 | **/maven-repo 37 | 38 | # User-specific stuff 39 | **/.env 40 | !images/.env 41 | **/.local 42 | **/notes 43 | **/.DS_Store 44 | **/temp 45 | **/local-plugins 46 | **/manifests/release 47 | **/docs-static -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Geoclient 2 | 3 | This project is now considered a downstream repository. The actively maintained Geoclient project is here: [https://github.com/mlipper/geoclient](https://github.com/mlipper/geoclient) 4 | -------------------------------------------------------------------------------- /buildSrc/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | gradlePluginPortal() 4 | } 5 | } 6 | 7 | dependencyResolutionManagement { 8 | versionCatalogs { 9 | libs { 10 | from(files("../gradle/libs.versions.toml")) 11 | } 12 | } 13 | } 14 | rootProject.name='geoclient-conventions' -------------------------------------------------------------------------------- /buildSrc/src/main/groovy/geoclient.library-conventions.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'java-library' 3 | id 'maven-publish' 4 | id 'geoclient.java-conventions' 5 | } 6 | 7 | publishing { 8 | publications { 9 | library(MavenPublication) { 10 | from components.java 11 | } 12 | } 13 | repositories { 14 | maven { 15 | name "localRepo" 16 | url layout.buildDirectory.dir("repo") 17 | } 18 | } 19 | } 20 | 21 | def jarTaskCollection = tasks.withType(Jar).matching { 22 | it.name in ['jar', 'javadocJar', 'sourcesJar'] 23 | } 24 | 25 | jarTaskCollection.all { 26 | manifest = java.manifest { 27 | from project.sharedManifest 28 | } 29 | with(project.licenseFilesSpec) 30 | } 31 | 32 | //signing { 33 | // sign publishing.publications.mavenJava 34 | //} 35 | 36 | //tasks.register('publications') { 37 | // group = 'Help' 38 | // description 'Lists publications from all java-library projects.' 39 | // doLast { 40 | // publishing.publications.each { 41 | // logger.quiet("[{}] {}:{}", it.name, it.artifactId, it.version) 42 | // it.artifacts.each { a -> 43 | // String padding = " ".multiply(it.name.length() - a.extension.length()) 44 | // logger.quiet("{}[{}] {}", padding, a.extension, a.file.absolutePath) 45 | // } 46 | // } 47 | // } 48 | //} 49 | -------------------------------------------------------------------------------- /buildSrc/src/main/java/geoclientbuild/docs/DefaultHttpClientManager.java: -------------------------------------------------------------------------------- 1 | package geoclientbuild.docs; 2 | 3 | import java.io.IOException; 4 | 5 | import org.apache.hc.client5.http.impl.classic.CloseableHttpClient; 6 | import org.apache.hc.client5.http.impl.classic.HttpClients; 7 | import org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager; 8 | 9 | // See https://github.com/eugenp/tutorials/blob/master/apache-httpclient/src/test/java/com/baeldung/httpclient/conn/HttpClientConnectionManagementLiveTest.java 10 | public class DefaultHttpClientManager implements HttpClientManager { 11 | 12 | private final PoolingHttpClientConnectionManager connManager = new PoolingHttpClientConnectionManager(); 13 | 14 | @Override 15 | public CloseableHttpClient getCloseableHttpClient() throws InterruptedException, IOException { 16 | return HttpClients.custom().setConnectionManager(connManager).build(); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /buildSrc/src/main/java/geoclientbuild/docs/DocumentationPlugin.java: -------------------------------------------------------------------------------- 1 | package geoclientbuild.docs; 2 | 3 | import org.gradle.api.Plugin; 4 | import org.gradle.api.Project; 5 | import org.gradle.api.plugins.JavaPlugin; 6 | import org.slf4j.Logger; 7 | import org.slf4j.LoggerFactory; 8 | 9 | public class DocumentationPlugin implements Plugin { 10 | 11 | public static final String GENERATE_SAMPLES_TASK_NAME = "generateSamples"; 12 | private Logger logger = LoggerFactory.getLogger(DocumentationPlugin.class); 13 | 14 | public void apply(Project project) { 15 | logger.info("Applying DocumentationPlugin..."); 16 | project.getTasks().register(GENERATE_SAMPLES_TASK_NAME, GenerateSamplesTask.class); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /buildSrc/src/main/java/geoclientbuild/docs/Endpoints.java: -------------------------------------------------------------------------------- 1 | package geoclientbuild.docs; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | 6 | public class Endpoints { 7 | 8 | public static final String ADDRESS = "address"; 9 | public static final String SEARCH = "search"; 10 | public static final String VERSION = "version"; 11 | public static final String RC_NOT_IMPLEMENTED_JSON_TEMPLATE = "{ \"returnCode\": \"EE\", \"message\": \"Endpoint %s has not been implemented.\" }"; 12 | 13 | private final String baseUri; 14 | private final Map endpoints = new HashMap<>(); 15 | 16 | /** 17 | * @param baseUri 18 | */ 19 | public Endpoints(String baseUri) { 20 | this.baseUri = baseUri; 21 | endpoints.put(ADDRESS, new Endpoint(ADDRESS, baseUri)); 22 | endpoints.put(SEARCH, new Endpoint(SEARCH, baseUri)); 23 | endpoints.put(VERSION, new Endpoint(VERSION, baseUri)); 24 | } 25 | 26 | public String getBaseUri() { 27 | return baseUri; 28 | } 29 | 30 | public boolean contains(String name) { 31 | return this.endpoints.containsKey(name); 32 | } 33 | 34 | public Endpoint get(String name) { 35 | return this.endpoints.get(name); 36 | } 37 | 38 | public Endpoint getAddress() { 39 | return endpoints.get(ADDRESS); 40 | } 41 | 42 | public Endpoint getSearch() { 43 | return endpoints.get(SEARCH); 44 | } 45 | 46 | public Endpoint getVersion() { 47 | return endpoints.get(VERSION); 48 | } 49 | 50 | 51 | } 52 | -------------------------------------------------------------------------------- /buildSrc/src/main/java/geoclientbuild/docs/HttpClientManager.java: -------------------------------------------------------------------------------- 1 | package geoclientbuild.docs; 2 | 3 | import java.io.IOException; 4 | 5 | import org.apache.hc.client5.http.impl.classic.CloseableHttpClient; 6 | 7 | public interface HttpClientManager { 8 | CloseableHttpClient getCloseableHttpClient() throws InterruptedException, IOException; 9 | } 10 | -------------------------------------------------------------------------------- /buildSrc/src/main/java/geoclientbuild/runner/ServiceRunnerTask.java: -------------------------------------------------------------------------------- 1 | package geoclientbuild.runner; 2 | 3 | import org.gradle.api.DefaultTask; 4 | import org.gradle.api.file.RegularFileProperty; 5 | import org.gradle.api.provider.ListProperty; 6 | import org.gradle.api.tasks.Input; 7 | import org.gradle.api.tasks.InputFile; 8 | import org.gradle.api.tasks.TaskAction; 9 | import org.gradle.workers.WorkerExecutor; 10 | import javax.inject.Inject; 11 | 12 | public abstract class ServiceRunnerTask extends DefaultTask { 13 | @Input 14 | abstract ListProperty getActiveProfiles(); 15 | @InputFile 16 | abstract RegularFileProperty getJarFile(); 17 | @Input 18 | abstract ListProperty getJvmArguments(); 19 | @Inject 20 | abstract public WorkerExecutor getWorkerExecutor(); 21 | 22 | @TaskAction 23 | public void execute() { 24 | 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /buildSrc/src/main/resources/requests.json: -------------------------------------------------------------------------------- 1 | { 2 | "requests": [ 3 | { "id": "100", "type": "address", "parameters": { "houseNumber": "280", "street": "riverside drive", "borough": "manhattan" } }, 4 | { "id": "200", "type": "addresspoint", "parameters": { "houseNumber": "280", "street": "riverside drive", "borough": "manhattan" } }, 5 | { "id": "300", "type": "bbl", "parameters": { "borough": "manhattan", "block": "186", "lot": "1" } }, 6 | { "id": "400", "type": "bin", "parameters": { "bin": "1234567" } }, 7 | { "id": "500", "type": "blockface", "parameters": { "onStreet": "broadway", "crossStreetOne": "w 100 st", "crossStreetTwo": "w 101 st", "borough": "manhattan" } }, 8 | { "id": "600", "type": "intersection", "parameters": { "crossStreetOne": "w 100 st", "crossStreetTwo": "amstersdam ave", "borough": "manhattan" } }, 9 | { "id": "700", "type": "normalize", "parameters": { "name": "east 158th Street" } }, 10 | { "id": "800", "type": "place", "parameters": { "name": "empire state building", "borough": "manhattan" } }, 11 | { "id": "900", "type": "search", "parameters": { "input": "280 riverside drive manhattan" } }, 12 | { "id": "901", "type": "search", "parameters": { "input": "280 riverside drive 10025", "returnTokens": "true" } }, 13 | { "id": "1000", "type": "streetCode", "parameters": { "streetCode": "10234567" } }, 14 | { "id": "1100", "type": "streetCode/b5sc", "parameters": { "streetCode": "102345" } }, 15 | { "id": "1200", "type": "version", "parameters": {} } 16 | ] 17 | } -------------------------------------------------------------------------------- /ci/azure-pipelines.yml: -------------------------------------------------------------------------------- 1 | # Docker 2 | # Build a Docker image 3 | # https://docs.microsoft.com/azure/devops/pipelines/languages/docker 4 | 5 | trigger: 6 | - pipeline 7 | 8 | resources: 9 | - repo: self 10 | 11 | variables: 12 | srcdir: '$(Build.SourcesDirectory)' 13 | tag: '$(Build.BuildId)' 14 | group: geosupport-environment 15 | 16 | stages: 17 | - stage: Build 18 | displayName: Build image 19 | jobs: 20 | - job: Build 21 | displayName: Build 22 | pool: 23 | vmImage: ubuntu-latest 24 | steps: 25 | - script: | 26 | docker build -f ./ci/Dockerfile -t mlipper/geoclient:$(tag) . 27 | docker run --name geoclient --rm -d mlipper/geoclient:$(tag) 28 | docker cp geoclient:/app/ci $(System.DefaultWorkingDirectory) 29 | docker cp geoclient:/app/geoclient.jar $(System.DefaultWorkingDirectory) 30 | docker stop geoclient 31 | - task: PublishTestResults@2 32 | inputs: 33 | mergeTestResults: true 34 | testRunner: JUnit 35 | testResultsFiles: $(System.DefaultWorkingDirectory)/ci/test-results/TEST-*.xml 36 | failTaskOnFailedTests: true 37 | - task: PublishCodeCoverageResults@2 38 | inputs: 39 | summaryFileLocation: $(System.DefaultWorkingDirectory)/ci/coverage/*-coverage.xml 40 | pathToSources: $(System.DefaultWorkingDirectory)/ci/src 41 | failIfCoverageEmpty: false 42 | - task: PublishPipelineArtifact@1 43 | inputs: 44 | targetPath: $(System.DefaultWorkingDirectory)/geoclient.jar 45 | publishLocation: pipeline 46 | -------------------------------------------------------------------------------- /documentation/src/docs/asciidoc/attributes.adoc: -------------------------------------------------------------------------------- 1 | //Base Links 2 | :dcp-base: https://www.nyc.gov/site/planning 3 | :dcp-geosupport: {dcp-base}/data-maps/open-data.page#geocoding_application 4 | :dcp-goat: https://a030-goat.nyc.gov/goat 5 | :dcp-site: {dcp-base}/index.page 6 | :dcp-upg: https://nycplanning.github.io/Geosupport-UPG 7 | :dcp-upg-cows: {dcp-upg}/appendices/appendix13 8 | :geoclient-repo: https://github.com/mlipper/geoclient 9 | :geoclient-nyc-repo: https://github.com/CityOfNewYork/geoclient -------------------------------------------------------------------------------- /documentation/src/docs/asciidoc/docinfo.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /documentation/src/docs/asciidoc/images/geoclient-runtime.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CityOfNewYork/geoclient/2aa792c401445f232eb7266efaa43b2cdfc443c3/documentation/src/docs/asciidoc/images/geoclient-runtime.png -------------------------------------------------------------------------------- /documentation/src/docs/asciidoc/index.adoc: -------------------------------------------------------------------------------- 1 | [[user-guide]] 2 | = Geoclient User Guide 3 | :last-update-label!: 4 | 5 | include::attributes.adoc[] 6 | 7 | Geoclient is software which provides developer-friendly API's for geocoding New York City location information by proxying requests to Geosupport which is the City's official geocoder of record. 8 | 9 | include::parts/concepts.adoc[] 10 | 11 | include::parts/rest-service.adoc[] 12 | 13 | include::parts/geosupport-docs.adoc[] 14 | 15 | include::parts/development.adoc[] 16 | 17 | include::parts/code-samples.adoc[] 18 | 19 | == Contact Us 20 | 21 | With questions, comments, feature requests, bug reports, threats, etc. 22 | 23 | ''' 24 | 25 | * Feature requests 26 | * Bug reports 27 | * Development questions -------------------------------------------------------------------------------- /documentation/src/docs/asciidoc/legacy/native.adoc: -------------------------------------------------------------------------------- 1 | # Native Environment Configuration 2 | 3 | == Diagnostic Tools 4 | 5 | _Show build files which use native compilation variables:_ 6 | 7 | [,bash] 8 | ---- 9 | find . -name '*.gradle' -type f -exec egrep -li --color '(g[cs][a-z]+Path|geofiles)' {} \; 10 | ---- 11 | 12 | _Show line content of Gradle files using native compilation variables:_ 13 | 14 | [,bash] 15 | ---- 16 | find . -name '*.gradle' -type f -exec egrep -Hin --color '(g[cs][a-z]+Path|geofiles)' {} \; 17 | ---- 18 | 19 | == Geoclient Variables 20 | 21 | |=== 22 | | Gradle Property | Environment Variable | Linux | Windows 23 | 24 | | `gsIncludePath` 25 | | `GS_INCLUDE_PATH` 26 | | `geo.h`, `pac.h`, `wa_fields.h` 27 | | `NYCgeo.h`, `geo.h`, `pac.h` 28 | 29 | | `gsLibraryPath` 30 | | `GS_LIBRARY_PATH` 31 | | `lib*.so` 32 | | `*.dll` 33 | 34 | | `gcIncludePath` 35 | | `GC_INCLUDE_PATH` 36 | | `geoclient.h` 37 | | `geoclient.h` 38 | 39 | | `gcLibraryPath` 40 | | `GC_LIBRARY_PATH` 41 | | `libgeoclientjni-linux_x64.so` 42 | | `geoclientjni-windows_x64.dll` 43 | |=== 44 | 45 | == Platform/Runtime Variables 46 | 47 | |=== 48 | | Java System Property | Linux Default Value | Windows Default Value | Geoclient Logic 49 | 50 | | `-Djava.library.path` 51 | | `LD_LIBRARY_PATH` 52 | | `PATH` 53 | | n/a 54 | 55 | | `-Djava.home` 56 | | `JAVA_HOME` 57 | | `JAVA_HOME` 58 | | `JNI_JAVA_HOME` 59 | |=== 60 | -------------------------------------------------------------------------------- /documentation/src/docs/asciidoc/parts/geosupport-docs.adoc: -------------------------------------------------------------------------------- 1 | == Geosupport Documentation 2 | 3 | This section provides links to Department of City Planning's documentation for Geosupport. 4 | 5 | ''' 6 | 7 | === Geosupport Return Codes -------------------------------------------------------------------------------- /documentation/src/docs/asciidoc/parts/presentations.adoc: -------------------------------------------------------------------------------- 1 | == Presentations 2 | 3 | Links to past presentations about Geoclient. 4 | 5 | ''' 6 | 7 | Here's some older presentations given about Geoclient: 8 | 9 | * NYC School of Data[https://schoolofdata.nyc/] presentation[https://github.com/mlipper/geoclient/blob/main/src/doc/presentations/geoclient-why-bother.pdf] 10 | * BetaNYC[http://betanyc.us/] presentation[https://github.com/mlipper/geoclient/blob/main/src/doc/presentations/BetaNYC-nyc-doitt-geoclient.pdf] 11 | * Code4LibNyc[http://code4lib.org/] presentation[https://github.com/mlipper/geoclient/blob/main/src/doc/presentations/Code4LibNYC-geoclient-overview.pdf] 12 | * GeoNYC[http://www.meetup.com/geonyc] presentation[https://github.com/mlipper/geoclient/blob/main/src/doc/presentations/nyc-geoclient-api.pdf] 13 | -------------------------------------------------------------------------------- /documentation/src/docs/asciidoc/parts/release-notes.adoc: -------------------------------------------------------------------------------- 1 | == Release Notes 2 | 3 | === 2.0.1 4 | 5 | ==== Potential Breaking Changes 6 | 7 | * Project `geoclient-service` 8 | * The `addresspoint` endpoint now returns `latitude` and `longitude` as double precision JSON numbers instead of strings. 9 | 10 | ==== New Features 11 | 12 | ==== Bug Fixes 13 | 14 | * Project `geoclient-service` 15 | * For the `addresspoint` endpoint (Geosupport function `AP`), return `latitude` and `longitude` as double precision JSON numbers instead of strings to be consistent with other endpoints. 16 | 17 | ==== Documentation 18 | 19 | * New documentation site: -------------------------------------------------------------------------------- /documentation/src/integrationTest/java/gov/nyc/doitt/gis/geoclient/docs/SampleGeneratorApplicationTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.docs; 17 | 18 | import org.junit.jupiter.api.Test; 19 | import org.springframework.boot.test.context.SpringBootTest; 20 | 21 | @SpringBootTest 22 | class SampleGeneratorApplicationTests { 23 | 24 | @Test 25 | void contextLoads() { 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /documentation/src/integrationTest/resources/address.csv: -------------------------------------------------------------------------------- 1 | id, endpoint, description, houseNumber, street, borough, zip 2 | 1, address, with borough, 314, w 100 st, manhattan, "" 3 | 2, address, with zip, 314, w 100 st, "", 10025 -------------------------------------------------------------------------------- /documentation/src/integrationTest/resources/addresspoint.csv: -------------------------------------------------------------------------------- 1 | id, endpoint, description, houseNumber, street, borough, zip 2 | 1, addresspoint, with borough, 314, w 100 st, manhattan, "" 3 | 2, addresspoint, with zip, 314, w 100 st, "", 10025 -------------------------------------------------------------------------------- /documentation/src/integrationTest/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | jackson: 3 | serialization: 4 | indent-output: true 5 | logging: 6 | group: 7 | geoclient-all: gov.nyc.doitt.gis.geoclient 8 | junit-condition: org.junit.jupiter.api.condition 9 | spring-all: org.springframework 10 | spring-boot-all: org.springframework.boot 11 | level: 12 | root: WARN 13 | geoclient-all: INFO 14 | #junit-condition: INFO 15 | #spring-all: INFO 16 | spring-boot-all: INFO 17 | file: 18 | name: build/integration-test.log 19 | -------------------------------------------------------------------------------- /documentation/src/integrationTest/resources/bbl.csv: -------------------------------------------------------------------------------- 1 | id,endpoint,description,borough,block,lot 2 | 1,bbl,basic bbl,manhattan,67,1 3 | -------------------------------------------------------------------------------- /documentation/src/integrationTest/resources/bin.csv: -------------------------------------------------------------------------------- 1 | id,endpoint,description,bin 2 | 1,bin,basic bin,1079043 3 | -------------------------------------------------------------------------------- /documentation/src/integrationTest/resources/blockface.csv: -------------------------------------------------------------------------------- 1 | id, endpoint, description, onStreet, crossStreetOne, crossStreetTwo, borough, boroughCrossStreetOne, boroughCrossStreetTwo, compassDirection 2 | 1, blockface, basic usage, broadway, w 100 st, w 101 st, manhattan, "", "", "" -------------------------------------------------------------------------------- /documentation/src/integrationTest/resources/intersection.csv: -------------------------------------------------------------------------------- 1 | id, endpoint, description, crossStreetOne, crossStreetTwo, borough, boroughCrossStreetTwo, compassDirection 2 | 1, intersection, basic usage, broadway, w 100 st, manhattan, "", "" -------------------------------------------------------------------------------- /documentation/src/integrationTest/resources/search.csv: -------------------------------------------------------------------------------- 1 | id, endpoint, description, input, returnTokens, returnRejections, returnPossiblesWithExactMatch, returnPolicy 2 | 1, search, address with borough, 314 w 100 st manhattan, "", "", "", "" 3 | 2, search, address with zip, 314 w 100 st 10025, "", "", "", "" -------------------------------------------------------------------------------- /documentation/src/integrationTest/resources/version.csv: -------------------------------------------------------------------------------- 1 | id,endpoint,description 2 | 1,version,version call -------------------------------------------------------------------------------- /documentation/src/main/java/gov/nyc/doitt/gis/geoclient/docs/DocumentationException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.docs; 17 | 18 | /** 19 | * General {@link RuntimeException} indicating fatal, unrecoverable error. 20 | * 21 | * @author mlipper 22 | */ 23 | public class DocumentationException extends RuntimeException { 24 | 25 | public DocumentationException(String message, Throwable cause) { 26 | super(message, cause); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /documentation/src/main/java/gov/nyc/doitt/gis/geoclient/docs/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Generates sample responses from {@code geoclient-service}. 19 | * 20 | * @author mlipper 21 | */ 22 | 23 | package gov.nyc.doitt.gis.geoclient.docs; 24 | -------------------------------------------------------------------------------- /documentation/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | # Conversion to YAML from Properties formar report 2 | # Warnings: 3 | # - The yaml file had comments which are lost in the refactoring! 4 | spring: 5 | application: 6 | name: sample-generator 7 | main: 8 | web-application-type: none 9 | banner-mode: off 10 | jackson: 11 | serialization: 12 | indent-output: true 13 | #generator: 14 | # base-url: '' 15 | # output-dir: '' 16 | logging: 17 | group: 18 | geoclient-all: gov.nyc.doitt.gis.geoclient 19 | spring-all: org.springframework 20 | level: 21 | root: WARN 22 | geoclient-all: INFO 23 | spring-all: INFO 24 | -------------------------------------------------------------------------------- /geoclient-core/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'geoclient.library-conventions' 3 | id 'geoclient.test-conventions' 4 | } 5 | 6 | dependencies { 7 | implementation(project(':geoclient-jni')) 8 | // Version specified by catalog platform libs.spring.boot.dependencies 9 | implementation('org.apache.commons:commons-lang3') 10 | implementation(libs.xstream) { 11 | exclude group: 'xpp3', module: 'xpp3_min' 12 | exclude group: 'xmlpull', module: 'xmlpull' 13 | } 14 | testImplementation(testFixtures(project(':geoclient-jni'))) 15 | } 16 | -------------------------------------------------------------------------------- /geoclient-core/doc/function-api.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CityOfNewYork/geoclient/2aa792c401445f232eb7266efaa43b2cdfc443c3/geoclient-core/doc/function-api.png -------------------------------------------------------------------------------- /geoclient-core/doc/function-call-sequence.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CityOfNewYork/geoclient/2aa792c401445f232eb7266efaa43b2cdfc443c3/geoclient-core/doc/function-call-sequence.png -------------------------------------------------------------------------------- /geoclient-core/etc/workareas.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CityOfNewYork/geoclient/2aa792c401445f232eb7266efaa43b2cdfc443c3/geoclient-core/etc/workareas.xlsx -------------------------------------------------------------------------------- /geoclient-core/src/main/java/gov/nyc/doitt/gis/geoclient/api/Coded.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.api; 17 | 18 | public interface Coded { 19 | String getCode(); 20 | } 21 | -------------------------------------------------------------------------------- /geoclient-core/src/main/java/gov/nyc/doitt/gis/geoclient/api/Named.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.api; 17 | 18 | public interface Named { 19 | String getName(); 20 | } 21 | -------------------------------------------------------------------------------- /geoclient-core/src/main/java/gov/nyc/doitt/gis/geoclient/api/Response.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.api; 17 | 18 | public class Response { 19 | 20 | public Response() { 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /geoclient-core/src/main/java/gov/nyc/doitt/gis/geoclient/api/ReturnCodeValue.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.api; 17 | 18 | public enum ReturnCodeValue { 19 | 20 | SUCCESS("00"), 21 | WARN("01"), 22 | COMPASS_DIRECTION_REQUIRED("02"), 23 | NOT_RECOGNIZED_NO_SIMILAR_NAMES("11"), 24 | NOT_RECOGNIZED_WITH_SIMILAR_NAMES("EE"); 25 | 26 | private final String value; 27 | 28 | private ReturnCodeValue(String value) { 29 | this.value = value; 30 | } 31 | 32 | public String value() { 33 | return this.value; 34 | } 35 | 36 | public boolean is(String string) { 37 | return this.value.equals(string); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /geoclient-core/src/main/java/gov/nyc/doitt/gis/geoclient/api/Street.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.api; 17 | 18 | public class Street extends CodeNamedValue { 19 | 20 | public Street(String code, String name) { 21 | super(code, name, false); 22 | } 23 | 24 | public Street(String name) { 25 | super(null, name, false); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /geoclient-core/src/main/java/gov/nyc/doitt/gis/geoclient/api/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Api package. 19 | * 20 | * @author Matthew Lipper 21 | */ 22 | 23 | package gov.nyc.doitt.gis.geoclient.api; 24 | -------------------------------------------------------------------------------- /geoclient-core/src/main/java/gov/nyc/doitt/gis/geoclient/cli/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Cli package. 19 | * 20 | * @author Matthew Lipper 21 | */ 22 | 23 | package gov.nyc.doitt.gis.geoclient.cli; 24 | -------------------------------------------------------------------------------- /geoclient-core/src/main/java/gov/nyc/doitt/gis/geoclient/config/ConfigurationException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.config; 17 | 18 | public abstract class ConfigurationException extends RuntimeException { 19 | 20 | private static final long serialVersionUID = 1L; 21 | 22 | public ConfigurationException(String message) { 23 | super(message); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /geoclient-core/src/main/java/gov/nyc/doitt/gis/geoclient/config/InvalidWorkAreaLengthException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.config; 17 | 18 | import gov.nyc.doitt.gis.geoclient.function.WorkArea; 19 | 20 | public class InvalidWorkAreaLengthException extends ConfigurationException { 21 | private static final long serialVersionUID = 2151574091751991095L; 22 | 23 | public InvalidWorkAreaLengthException(WorkArea workArea, int expectedLength) { 24 | super(String.format("Length of WorkArea [id=%s] is invalid: expected=%d, actual=%d", workArea.getId(), 25 | expectedLength, workArea.length())); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /geoclient-core/src/main/java/gov/nyc/doitt/gis/geoclient/config/UnknownFunctionException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.config; 17 | 18 | public class UnknownFunctionException extends ConfigurationException { 19 | 20 | private static final long serialVersionUID = 1L; 21 | 22 | public UnknownFunctionException(String functionId) { 23 | super(String.format("Unknown function id '%s'", functionId)); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /geoclient-core/src/main/java/gov/nyc/doitt/gis/geoclient/config/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Config package. 19 | * 20 | * @author Matthew Lipper 21 | */ 22 | 23 | package gov.nyc.doitt.gis.geoclient.config; 24 | -------------------------------------------------------------------------------- /geoclient-core/src/main/java/gov/nyc/doitt/gis/geoclient/config/xml/XmlConfigurationException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.config.xml; 17 | 18 | import gov.nyc.doitt.gis.geoclient.config.ConfigurationException; 19 | 20 | public class XmlConfigurationException extends ConfigurationException { 21 | 22 | private static final long serialVersionUID = -3395332933825332949L; 23 | 24 | public XmlConfigurationException(String message) { 25 | super(message); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /geoclient-core/src/main/java/gov/nyc/doitt/gis/geoclient/config/xml/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Xml package. 19 | * 20 | * @author Matthew Lipper 21 | */ 22 | 23 | package gov.nyc.doitt.gis.geoclient.config.xml; 24 | -------------------------------------------------------------------------------- /geoclient-core/src/main/java/gov/nyc/doitt/gis/geoclient/function/Configuration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.function; 17 | 18 | import java.util.Map; 19 | 20 | /** 21 | * Configuration information of {@link Function} defaults and settings. 22 | * 23 | * @author mlipper 24 | * 25 | */ 26 | public interface Configuration { 27 | Map requiredArguments(); 28 | } 29 | -------------------------------------------------------------------------------- /geoclient-core/src/main/java/gov/nyc/doitt/gis/geoclient/function/DefaultConfiguration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.function; 17 | 18 | import java.util.Collections; 19 | import java.util.Map; 20 | 21 | public class DefaultConfiguration implements Configuration { 22 | private Map requiredArguments; 23 | 24 | @Override 25 | public Map requiredArguments() { 26 | if (requiredArguments == null) { 27 | return null; 28 | } 29 | return Collections.unmodifiableMap(this.requiredArguments); 30 | } 31 | 32 | public void setRequiredArguments(Map requiredArguments) { 33 | this.requiredArguments = requiredArguments; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /geoclient-core/src/main/java/gov/nyc/doitt/gis/geoclient/function/Filter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.function; 17 | 18 | import gov.nyc.doitt.gis.geoclient.util.Assert; 19 | 20 | public class Filter { 21 | private final String pattern; 22 | 23 | public Filter(String pattern) { 24 | super(); 25 | Assert.notNull(pattern, "Pattern argument cannot be null"); 26 | this.pattern = pattern; 27 | } 28 | 29 | public boolean matches(Field field) { 30 | return field.getId().matches(pattern); 31 | } 32 | 33 | @Override 34 | public String toString() { 35 | return "Filter [pattern=" + pattern + "]"; 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /geoclient-core/src/main/java/gov/nyc/doitt/gis/geoclient/function/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Function package. 19 | * 20 | * @author Matthew Lipper 21 | */ 22 | 23 | package gov.nyc.doitt.gis.geoclient.function; 24 | -------------------------------------------------------------------------------- /geoclient-core/src/main/java/gov/nyc/doitt/gis/geoclient/util/ByteBufferUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.util; 17 | 18 | import java.nio.ByteBuffer; 19 | import java.nio.CharBuffer; 20 | import java.nio.charset.CharacterCodingException; 21 | import java.nio.charset.Charset; 22 | import java.nio.charset.CharsetDecoder; 23 | 24 | public class ByteBufferUtils { 25 | private static final Charset CHARSET = Charset.forName("UTF-8"); 26 | private static final CharsetDecoder DECODER = CHARSET.newDecoder(); 27 | 28 | public static String readString(ByteBuffer buffer) throws CharacterCodingException { 29 | int position = buffer.position(); 30 | CharBuffer charBuffer = DECODER.decode(buffer); 31 | buffer.position(position); 32 | return charBuffer.toString(); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /geoclient-core/src/main/java/gov/nyc/doitt/gis/geoclient/util/ClassUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.util; 17 | 18 | public class ClassUtils { 19 | 20 | /* 21 | * Copied from org.springframework.util.ClassUtils#getDefaultClassLoader 22 | */ 23 | public static ClassLoader getDefaultClassLoader() { 24 | ClassLoader cl = null; 25 | try { 26 | cl = Thread.currentThread().getContextClassLoader(); 27 | } 28 | catch (Throwable ex) { 29 | // Cannot access thread context ClassLoader - falling back to system 30 | // class loader... 31 | } 32 | if (cl == null) { 33 | // No thread context class loader -> use class loader of this class. 34 | cl = ClassUtils.class.getClassLoader(); 35 | } 36 | return cl; 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /geoclient-core/src/main/java/gov/nyc/doitt/gis/geoclient/util/OperatingSystemUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.util; 17 | 18 | public class OperatingSystemUtils { 19 | 20 | private static final String osName = System.getProperty("os.name"); 21 | 22 | public static boolean isWindows() { 23 | return osName.contains("Windows"); 24 | } 25 | 26 | public static String uname() { 27 | return osName; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /geoclient-core/src/main/java/gov/nyc/doitt/gis/geoclient/util/StringUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.util; 17 | 18 | import java.util.Optional; 19 | 20 | public class StringUtils { 21 | 22 | private StringUtils() { 23 | } 24 | 25 | public static Optional optionalStringValue(Object obj) { 26 | if (obj != null) { 27 | return Optional.of(obj.toString()); 28 | } 29 | return Optional.empty(); 30 | } 31 | 32 | public static String stringOrNullValueOf(Object obj) { 33 | if (obj != null) { 34 | return obj.toString(); 35 | } 36 | return null; 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /geoclient-core/src/main/java/gov/nyc/doitt/gis/geoclient/util/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Util package. 19 | * 20 | * @author Matthew Lipper 21 | */ 22 | 23 | package gov.nyc.doitt.gis.geoclient.util; 24 | -------------------------------------------------------------------------------- /geoclient-core/src/main/python/gen-fn1a-geographic-ids.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | start=251 4 | length=16 5 | for x in range(1,22): 6 | print '#################################' 7 | print '### Geographic identifier {0} ###'.format(x) 8 | print '#################################' 9 | 10 | print 'giLowHouseNumber{0}={1},{2}'.format(x,start,length) 11 | 12 | length = 16 13 | start = start + 16 14 | print 'giHighHouseNumber{0}={1},{2}'.format(x,start,length) 15 | 16 | length = 8 17 | start = start + 16 18 | print 'giStreetCode{0}={1},{2},COMP'.format(x,start,length) 19 | 20 | length = 1 21 | ## Do not adjust start as previous field was composite 22 | print 'giBoroughCode{0}={1},{2}'.format(x,start,length) 23 | 24 | length = 5 25 | start = start + 1 26 | print 'gi5DigitStreetCode{0}={1},{2}'.format(x,start,length) 27 | 28 | length = 2 29 | start = start + 5 30 | print 'giDcpPreferredLgc{0}={1},{2}'.format(x,start,length) 31 | 32 | length = 7 33 | start = start + 2 34 | print 'giBuildingIdentificationNumber{0}={1},{2}'.format(x,start,length) 35 | 36 | length = 1 37 | start = start + 7 38 | print 'giSideOfStreetIndicator{0}={1},{2}'.format(x,start,length) 39 | 40 | length = 1 41 | start = start + 1 42 | print 'giGeographicIdentifier{0}={1},{2}'.format(x,start,length) 43 | 44 | length = 4 45 | start = start + 1 46 | print 'giFiller{0}={1},{2}'.format(x,start,length) 47 | 48 | length = 16 49 | start = start + 4 50 | -------------------------------------------------------------------------------- /geoclient-core/src/main/ruby/field.rb: -------------------------------------------------------------------------------- 1 | 2 | wa = ARGV[0] 3 | puts wa 4 | inf = File.new("#{wa}.properties") 5 | out = File.new("fields-#{wa}.xml", 'w') 6 | 7 | out.puts '' 8 | inf.each do |line| 9 | line.chomp! 10 | line.strip! 11 | if line.match('^\s*#') || line.empty? then 12 | puts "Skipping #{line}" 13 | next 14 | end 15 | id, val = line.split('=') 16 | start, len, ftype = val.split(',') 17 | ftype = 'REG' unless !ftype.nil? 18 | #xml = "" 19 | xml = "" 20 | puts xml 21 | out.puts xml 22 | end 23 | inf.close 24 | out.puts '' 25 | out.close 26 | -------------------------------------------------------------------------------- /geoclient-core/src/test/java/gov/nyc/doitt/gis/geoclient/function/GeosupportConfigurationTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.function; 17 | 18 | import static org.junit.jupiter.api.Assertions.assertEquals; 19 | import static org.junit.jupiter.api.Assertions.assertNotSame; 20 | import static org.junit.jupiter.api.Assertions.assertNull; 21 | 22 | import java.util.HashMap; 23 | import java.util.Map; 24 | 25 | import org.junit.jupiter.api.Test; 26 | 27 | public class GeosupportConfigurationTest { 28 | 29 | @Test 30 | public void testRequiredArguments() { 31 | DefaultConfiguration config = new DefaultConfiguration(); 32 | assertNull(config.requiredArguments()); 33 | Map args = new HashMap(); 34 | config.setRequiredArguments(args); 35 | assertNotSame(args, config.requiredArguments()); 36 | assertEquals(args, config.requiredArguments()); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /geoclient-core/src/test/java/gov/nyc/doitt/gis/geoclient/test/Fixtures.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.test; 17 | 18 | import gov.nyc.doitt.gis.geoclient.config.xml.ConfigurationConverter; 19 | import gov.nyc.doitt.gis.geoclient.config.xml.FieldConverter; 20 | import gov.nyc.doitt.gis.geoclient.config.xml.GeoclientXmlReader; 21 | 22 | public class Fixtures { 23 | private final ConfigurationConverter.Metadata configurationConverterMetadata = GeoclientXmlReader.getConfigurationConverterMetadata(); 24 | private final FieldConverter.Metadata fieldConverterMetadata = GeoclientXmlReader.getFieldConverterMetadata(); 25 | 26 | public ConfigurationConverter.Metadata configurationConverterMetadata() { 27 | return configurationConverterMetadata; 28 | } 29 | 30 | public FieldConverter.Metadata fieldConverterMetadata() { 31 | return fieldConverterMetadata; 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /geoclient-core/src/test/java/gov/nyc/doitt/gis/geoclient/util/ByteBufferUtilsTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.util; 17 | 18 | import static org.junit.jupiter.api.Assertions.assertEquals; 19 | import static org.junit.jupiter.api.Assertions.assertTrue; 20 | 21 | import java.nio.ByteBuffer; 22 | 23 | import org.junit.jupiter.api.Test; 24 | 25 | public class ByteBufferUtilsTest { 26 | 27 | @Test 28 | public void testReadString() throws Exception { 29 | String string = "I like cake"; 30 | ByteBuffer buffer = ByteBuffer.wrap(string.getBytes()); 31 | int positionBeforeCall = buffer.position(); 32 | assertEquals(string, ByteBufferUtils.readString(buffer)); 33 | assertTrue(positionBeforeCall == buffer.position()); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /geoclient-core/src/test/java/gov/nyc/doitt/gis/geoclient/util/ClassUtilsTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.util; 17 | 18 | import static org.junit.jupiter.api.Assertions.assertNotNull; 19 | 20 | import org.junit.jupiter.api.Test; 21 | 22 | public class ClassUtilsTest { 23 | 24 | @Test 25 | public void testGetDefaultClassLoader() { 26 | assertNotNull(ClassUtils.getDefaultClassLoader()); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /geoclient-core/src/test/java/gov/nyc/doitt/gis/geoclient/util/OperatingSystemUtilsTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.util; 17 | 18 | import static org.junit.jupiter.api.Assertions.assertEquals; 19 | import static org.junit.jupiter.api.Assertions.assertFalse; 20 | import static org.junit.jupiter.api.Assertions.assertTrue; 21 | 22 | import org.junit.jupiter.api.Test; 23 | 24 | public class OperatingSystemUtilsTest { 25 | private static final String osName = System.getProperty("os.name"); 26 | 27 | @Test 28 | public void testIsWindows() { 29 | if (osName.contains("Windows")) { 30 | assertTrue(OperatingSystemUtils.isWindows()); 31 | } 32 | else { 33 | assertFalse(OperatingSystemUtils.isWindows()); 34 | } 35 | } 36 | 37 | @Test 38 | public void testUName() { 39 | assertEquals(osName, OperatingSystemUtils.uname()); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /geoclient-core/src/test/resources/duplicate_field.properties: -------------------------------------------------------------------------------- 1 | internalUse1Out=1,21 2 | # Duplicate: field already existing in WA1.properties 3 | geosupportReturnCode=22,2 -------------------------------------------------------------------------------- /geoclient-core/src/test/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 20 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /geoclient-jni/CHANGES.txt: -------------------------------------------------------------------------------- 1 | v1.0.10 2 | ======= 3 | - Added BBL to default tests in jni-test.conf 4 | - Upgrade to Geosupport v14.3.1 release 14D 5 | - Upgrade to Gluegen 2.2.4 6 | - Removed local copies of Geosupport headers and libs 7 | - Added versioned C binaries to project dist folder 8 | - Makefile fixes 9 | - Removed Makefiles hardcoded dependency on pom.xml execution 10 | 11 | v1.0.9 12 | ====== 13 | - Recompile against pac.h v13d2 for Sanitation organic recycling schedule 14 | - Cleaned up geoclient c files, removing unnecessary includes 15 | - Added manifest entries for implementation name and version 16 | - Updated Windows libs for desktop version 13.2 17 | 18 | v1.0.8 19 | ====== 20 | - Cross-platform Makefile that will build on MinGWin32 against Desktop Geosupport 21 | - Upgrade to parent pom gis-common-maven v1.0.5 making Java 7 the default 22 | - Updated deploy.sh script for deployment to staging directory on Linux 23 | - Enhanced JniTest to support a config file for test case data and better logging 24 | 25 | v1.0.7 26 | ====== 27 | - Added this file :) 28 | - Makefile enhancement to generate and stage geoclient-jni lib and jar installation 29 | - Added pac.h to this project since the one in the latest Geosupport distributions are broken 30 | -------------------------------------------------------------------------------- /geoclient-jni/dist/v1.0.10/linux-x86_64/ctest: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CityOfNewYork/geoclient/2aa792c401445f232eb7266efaa43b2cdfc443c3/geoclient-jni/dist/v1.0.10/linux-x86_64/ctest -------------------------------------------------------------------------------- /geoclient-jni/dist/v1.0.10/linux-x86_64/libGeoclientImpl_JNI.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CityOfNewYork/geoclient/2aa792c401445f232eb7266efaa43b2cdfc443c3/geoclient-jni/dist/v1.0.10/linux-x86_64/libGeoclientImpl_JNI.so -------------------------------------------------------------------------------- /geoclient-jni/dist/v1.0.10/mingw32-i686/GeoclientImpl_JNI.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CityOfNewYork/geoclient/2aa792c401445f232eb7266efaa43b2cdfc443c3/geoclient-jni/dist/v1.0.10/mingw32-i686/GeoclientImpl_JNI.dll -------------------------------------------------------------------------------- /geoclient-jni/dist/v1.0.10/mingw32-i686/ctest.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CityOfNewYork/geoclient/2aa792c401445f232eb7266efaa43b2cdfc443c3/geoclient-jni/dist/v1.0.10/mingw32-i686/ctest.exe -------------------------------------------------------------------------------- /geoclient-jni/lib/geosupport/headers/GLUEGEN_NEEDS_GEO_H_IN_WINDOWS_INCLUDE.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CityOfNewYork/geoclient/2aa792c401445f232eb7266efaa43b2cdfc443c3/geoclient-jni/lib/geosupport/headers/GLUEGEN_NEEDS_GEO_H_IN_WINDOWS_INCLUDE.txt -------------------------------------------------------------------------------- /geoclient-jni/lib/geosupport/headers/NYCgeo.h: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | #ifndef NYCgeoH 3 | #define NYCgeoH 4 | 5 | #ifdef __cplusplus 6 | extern "C" 7 | { 8 | __declspec(dllimport) void __stdcall NYCgeo(char *ptr_wa1, char *ptr_wa2=NULL); 9 | } 10 | #else 11 | { 12 | __declspec(dllimport) void __stdcall NYCgeo(char *ptr_wa1, char *ptr_wa2); 13 | } 14 | #endif 15 | #endif 16 | //--------------------------------------------------------------------------- 17 | -------------------------------------------------------------------------------- /geoclient-jni/lib/geosupport/headers/geo.h: -------------------------------------------------------------------------------- 1 | #ifndef NYCgeoH 2 | #define NYCgeoH 3 | 4 | /* 5 | * 2016-01-04 - Matthew Lipper 6 | * 7 | * Re-wrote this header to fix broken macro and Linux function definition. 8 | * 9 | */ 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | #ifdef _WIN32 16 | void __declspec(dllimport) __stdcall geo(char *ptr_wa1, char *ptr_wa2); 17 | #else 18 | void geo(char *ptr_wa1, char *ptr_wa2); 19 | #endif 20 | 21 | #ifdef __cplusplus 22 | } 23 | #endif 24 | 25 | #endif // NYCgeoH 26 | -------------------------------------------------------------------------------- /geoclient-jni/lib/geosupport/headers/geo.h.orig: -------------------------------------------------------------------------------- 1 | //--------------------------------------------------------------------------- 2 | 3 | #ifndef NYCgeoH 4 | #define NYCgeoH 5 | //--------------------------------------------------------------------------- 6 | 7 | //////////////////////////////////////////////////////////////////////////////// 8 | //*** below is the declaration for __stdcall (pascal) 9 | //////////////////////////////////////////////////////////////////////////////// 10 | #ifdef WIN32 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | //void __declspec(dllimport) __stdcall geo(char *ptr_wa1, char *ptr_wa2); 15 | //void ROLE __stdcall geo(char *ptr_wa1, char *ptr_wa2); 16 | void ROLE geo(char *ptr_wa1, char *ptr_wa2); 17 | #ifdef __cplusplus 18 | } 19 | #endif 20 | //--------------------------------------------------------------------------- 21 | #endif 22 | #elif defined (__linux__) 23 | extern void geo(char *ptr_wa1, char *ptr_wa2); 24 | #endif 25 | 26 | -------------------------------------------------------------------------------- /geoclient-jni/src/main/c/geoclient.c: -------------------------------------------------------------------------------- 1 | #include "geoclient.h" 2 | 3 | /* 4 | * Simple proxy for platform-dependent Geosupport function call 5 | */ 6 | void callgeo(char *work_area1, char *work_area2) { 7 | GEOSUPPORT_FUNC(work_area1, work_area2); 8 | } 9 | -------------------------------------------------------------------------------- /geoclient-jni/src/main/headers/geoclient.h: -------------------------------------------------------------------------------- 1 | #ifndef GEOCLIENT_H 2 | #define GEOCLIENT_H 3 | 4 | // The Geosupport C API uses platform-dependent function names: 5 | #ifdef _WIN32 6 | // When compiling with mingw64 on Windows (e.g., MSYS2 MINGW64 Shell) 7 | // make sure to have gcc tell the linker to add the WIN32 standard call 8 | // alias: '-Wl,--add-stdcall-alias'. This should result in the preprocessor 9 | // adding '__stdcall' and a space just before the resolved method name. 10 | #include "NYCgeo.h" 11 | #define GEOSUPPORT_FUNC(work_area1, work_area2) NYCgeo(work_area1, work_area2); 12 | 13 | #ifdef DLL_EXPORT 14 | #define GEOCLIENT_API __declspec(dllexport) 15 | #else 16 | // The following allows the geoclient shared lib to compile using VS2015 17 | //#define GEOSUPPORT_FUNC(work_area1, work_area2) __stdcall NYCgeo(work_area1, work_area2); 18 | 19 | // The following breaks ld when trying to statically link 20 | // geoclient_test.exe with geoclient.lib on Windows/MSYS2/mingw64: 21 | //#define GEOCLIENT_API __declspec(dllimport) 22 | 23 | #define GEOCLIENT_API 24 | #endif 25 | #else 26 | #include "geo.h" 27 | #define GEOSUPPORT_FUNC(work_area1, work_area2) geo(work_area1, work_area2); 28 | #define GEOCLIENT_API 29 | #endif 30 | 31 | #ifdef __cplusplus 32 | extern "C" { 33 | #endif 34 | 35 | GEOCLIENT_API void callgeo(char *work_area1, char *work_area2); 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | 41 | #endif /* GEOCLIENT_H */ 42 | -------------------------------------------------------------------------------- /geoclient-jni/src/main/java/gov/nyc/doitt/gis/geoclient/jni/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Top-level geoclient-jni Java package. 19 | * 20 | * @author Matthew Lipper 21 | */ 22 | 23 | package gov.nyc.doitt.gis.geoclient.jni; 24 | -------------------------------------------------------------------------------- /geoclient-jni/src/main/java/gov/nyc/doitt/gis/geoclient/jni/util/JniLibraryException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.jni.util; 17 | 18 | public class JniLibraryException extends RuntimeException { 19 | 20 | private static final long serialVersionUID = 2391394421092219469L; 21 | 22 | public JniLibraryException(String message, Throwable cause) { 23 | super(message, cause); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /geoclient-jni/src/main/java/gov/nyc/doitt/gis/geoclient/jni/util/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Utilities package for geoclient-jni. 19 | * 20 | * @author Matthew Lipper 21 | */ 22 | 23 | package gov.nyc.doitt.gis.geoclient.jni.util; 24 | -------------------------------------------------------------------------------- /geoclient-jni/src/test/java/gov/nyc/doitt/gis/geoclient/jni/util/JniLibraryExceptionTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.jni.util; 17 | 18 | import static org.junit.jupiter.api.Assertions.assertEquals; 19 | import static org.junit.jupiter.api.Assertions.assertSame; 20 | 21 | import org.junit.jupiter.api.Test; 22 | 23 | public class JniLibraryExceptionTest { 24 | @Test 25 | void testConstructor() { 26 | String message = "Something is broken"; 27 | RuntimeException throwable = new RuntimeException("kaboom"); 28 | JniLibraryException exception = new JniLibraryException(message, throwable); 29 | assertEquals(message, exception.getMessage()); 30 | assertSame(throwable, exception.getCause()); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /geoclient-jni/src/test/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d %p [%c] - <%m>%n 6 | 7 | 8 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /geoclient-parser/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'geoclient.library-conventions' 3 | id 'geoclient.test-conventions' 4 | } 5 | 6 | dependencies { 7 | implementation("org.springframework:spring-context") 8 | implementation("org.apache.commons:commons-lang3") 9 | testImplementation(libs.xstream) 10 | testImplementation(libs.diffutils) 11 | } 12 | -------------------------------------------------------------------------------- /geoclient-parser/etc/city.txt: -------------------------------------------------------------------------------- 1 | QUEENS VILLAGE|HOWARD BEACH|FLORAL PARK|SOUTH OZONE PARK|RIDGEWOOD|QS|ROSEDALE|SAINT ALBANS|NY, NY|FAR ROCKAWAY|MANHATTAN|BROOKLYN|BRONX|FOREST HILLS|ELMHURST|INWOOD|CORONA|QN|MN|BAYSIDE|NEW YORK|STATEN ISLAND|BREEZY POINT|WHITESTONE|OZONE PARK|CAMBRIA HEIGHTS|EAST ELMHURST|QUEENS|OAKLAND GARDENS|BX|MIDDLE VILLAGE|COLLEGE POINT|JACKSON HEIGHTS|BELLEROSE|FLUSHING|HOLLIS|SPRINGFIELD GARDENS|REGO PARK|BK|KEW GARDENS|FRESH MEADOWS|WOODHAVEN|WOODSIDE|MASPETH|SI|GLEN OAKS|NYC|ASTORIA|RICHMOND HILL|STATENISLAND|SOUTH RICHMOND HILL|LITTLE NECK|NEW HYDE PARK|ROCKAWAY PARK|JAMAICA|LONG ISLAND CITY|SUNNYSIDE|ARVERNE|NY NY|STATEN IS -------------------------------------------------------------------------------- /geoclient-parser/etc/zip.txt: -------------------------------------------------------------------------------- 1 | 10203|11096|10470|10471|10473|10472|10475|10474|10097|10096|10080|10081|10310|10312|10314|10075|11451|11358|11359|11356|11357|11354|11355|11224|11225|10065|11226|11220|11221|10069|11222|11223|11228|11229|11427|11426|11429|11428|11423|11422|11421|11420|11237|11238|11235|10055|11236|11233|11234|11231|11232|11239|11230|11436|11435|11434|11433|11432|11430|10048|10460|10047|11201|10044|11203|10043|10265|11204|11109|10045|11205|11206|11103|11104|11207|11105|11208|11209|11106|11101|11102|10469|10467|10468|10040|10041|10465|10466|10260|10463|10464|10461|10462|11211|10039|11212|10038|10259|10037|11210|10036|11215|10035|11216|10034|11213|10033|11214|10032|11219|11217|11218|11418|11417|11416|11415|10458|10459|11419|10454|00083|10030|10455|10031|10456|10457|11414|10451|11413|10452|11412|10453|11411|10152|10151|10158|10155|10153|10154|10162|10001|10002|11005|11004|10005|10006|10003|11001|10004|10009|10168|10169|10007|10165|10166|10167|10170|10174|10173|10172|10171|10271|10270|10014|10118|10016|10278|10119|10279|10017|10010|10011|10012|10013|10275|10177|10178|10110|10175|10111|10112|10176|10018|10019|10115|10282|10020|10281|10280|10027|10028|10128|10025|10026|10285|10023|10286|10024|10021|10022|10122|10123|10120|10121|10029|10196|10309|10308|10305|10304|10307|10306|10301|11251|10303|10302|11249|11040|11385|10105|10104|10103|11241|10107|10106|11694|11693|11697|11379|11378|11375|11374|11377|11370|11371|11372|11373|11691|11692|11369|11368|11367|11366|11365|11364|11363|11361|11362|11360 -------------------------------------------------------------------------------- /geoclient-parser/src/main/java/gov/nyc/doitt/gis/geoclient/parser/LocationTokenizer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.parser; 17 | 18 | public interface LocationTokenizer { 19 | LocationTokens parse(Input input); 20 | } 21 | -------------------------------------------------------------------------------- /geoclient-parser/src/main/java/gov/nyc/doitt/gis/geoclient/parser/Parser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.parser; 17 | 18 | public interface Parser { 19 | void parse(ParseContext parseContext); 20 | 21 | String getName(); 22 | } 23 | -------------------------------------------------------------------------------- /geoclient-parser/src/main/java/gov/nyc/doitt/gis/geoclient/parser/SingleFieldSearchParser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.parser; 17 | 18 | import java.util.List; 19 | 20 | public class SingleFieldSearchParser implements LocationTokenizer { 21 | private List parsers; 22 | 23 | public SingleFieldSearchParser(List parsers) { 24 | super(); 25 | this.parsers = parsers; 26 | } 27 | 28 | @Override 29 | public LocationTokens parse(Input input) { 30 | ParseContext parseContext = new ParseContext(input); 31 | for (Parser parser : this.parsers) { 32 | parser.parse(parseContext); 33 | if (parseContext.isParsed()) { 34 | break; 35 | } 36 | } 37 | 38 | return new LocationTokens(input, parseContext.getChunks()); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /geoclient-parser/src/main/java/gov/nyc/doitt/gis/geoclient/parser/configuration/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Configuration package. 19 | * 20 | * @author Matthew Lipper 21 | */ 22 | 23 | package gov.nyc.doitt.gis.geoclient.parser.configuration; 24 | -------------------------------------------------------------------------------- /geoclient-parser/src/main/java/gov/nyc/doitt/gis/geoclient/parser/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Parser package. 19 | * 20 | * @author Matthew Lipper 21 | */ 22 | 23 | package gov.nyc.doitt.gis.geoclient.parser; 24 | -------------------------------------------------------------------------------- /geoclient-parser/src/main/java/gov/nyc/doitt/gis/geoclient/parser/regex/MatchType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.parser.regex; 17 | 18 | public enum MatchType { 19 | COMPLETE, END_OF_INPUT, START_OF_INPUT 20 | } 21 | -------------------------------------------------------------------------------- /geoclient-parser/src/main/java/gov/nyc/doitt/gis/geoclient/parser/regex/ParseStatus.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.parser.regex; 17 | 18 | public enum ParseStatus { 19 | END_OF_INPUT, PARSING 20 | } 21 | -------------------------------------------------------------------------------- /geoclient-parser/src/main/java/gov/nyc/doitt/gis/geoclient/parser/regex/PatternUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.parser.regex; 17 | 18 | import java.util.Collection; 19 | 20 | import gov.nyc.doitt.gis.geoclient.parser.util.Assert; 21 | 22 | public class PatternUtils { 23 | public static String literalMatchGroup(Collection strings) { 24 | Assert.notEmpty(strings, "Collection of strings argument cannot be empty or null"); 25 | StringBuffer buff = new StringBuffer("("); 26 | for (String s : strings) { 27 | buff.append(s); 28 | buff.append("|"); 29 | } 30 | buff.deleteCharAt(buff.lastIndexOf("|")); 31 | buff.append(")"); 32 | return buff.toString(); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /geoclient-parser/src/main/java/gov/nyc/doitt/gis/geoclient/parser/regex/RegexTokenGroup.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.parser.regex; 17 | 18 | import java.util.regex.Pattern; 19 | 20 | import gov.nyc.doitt.gis.geoclient.parser.token.TokenType; 21 | 22 | public class RegexTokenGroup { 23 | private final Pattern pattern; 24 | private final int group; 25 | private final TokenType tokenType; 26 | 27 | public RegexTokenGroup(Pattern pattern, int group, TokenType tokenType) { 28 | super(); 29 | this.pattern = pattern; 30 | this.group = group; 31 | this.tokenType = tokenType; 32 | } 33 | 34 | public Pattern getPattern() { 35 | return pattern; 36 | } 37 | 38 | public TokenType getTokenType() { 39 | return tokenType; 40 | } 41 | 42 | public int getGroup() { 43 | return group; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /geoclient-parser/src/main/java/gov/nyc/doitt/gis/geoclient/parser/regex/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Regex package. 19 | * 20 | * @author Matthew Lipper 21 | */ 22 | 23 | package gov.nyc.doitt.gis.geoclient.parser.regex; 24 | -------------------------------------------------------------------------------- /geoclient-parser/src/main/java/gov/nyc/doitt/gis/geoclient/parser/test/TestConfigurationException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.parser.test; 17 | 18 | public class TestConfigurationException extends RuntimeException { 19 | 20 | private static final long serialVersionUID = 5574362457850309141L; 21 | 22 | public TestConfigurationException(String message) { 23 | super(message); 24 | } 25 | 26 | public TestConfigurationException(String message, Throwable cause) { 27 | super(message, cause); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /geoclient-parser/src/main/java/gov/nyc/doitt/gis/geoclient/parser/test/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Test package. 19 | * 20 | * @author Matthew Lipper 21 | */ 22 | 23 | package gov.nyc.doitt.gis.geoclient.parser.test; 24 | -------------------------------------------------------------------------------- /geoclient-parser/src/main/java/gov/nyc/doitt/gis/geoclient/parser/token/ChunkType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.parser.token; 17 | 18 | public enum ChunkType { 19 | ADDRESS, 20 | BBL, 21 | BIN, 22 | BLOCKFACE, 23 | COUNTY, 24 | INTERSECTION, 25 | HOUSE_NUMBER, 26 | STREET_NAME, 27 | ORIGINAL_INPUT, 28 | SUBSTRING, 29 | UNRECOGNIZED 30 | } 31 | -------------------------------------------------------------------------------- /geoclient-parser/src/main/java/gov/nyc/doitt/gis/geoclient/parser/token/TokenType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.parser.token; 17 | 18 | public enum TokenType { 19 | AND, 20 | BETWEEN, 21 | BIN, 22 | BLOCK, 23 | BOROUGH_CODE, 24 | BOROUGH_NAME, 25 | CITY_NAME, 26 | COMPASS_DIRECTION, 27 | CROSS_STREET_ONE, 28 | CROSS_STREET_TWO, 29 | COUNTRY, 30 | HOUSE_NUMBER, 31 | HOUSE_NUMBER_SUFFIX, 32 | LOT, 33 | NEIGHBORHOOD_NAME, 34 | ON, 35 | ON_STREET, 36 | STATE, 37 | STREET_NAME, 38 | UNRECOGNIZED, 39 | ZIP, 40 | PLUS4 41 | } 42 | -------------------------------------------------------------------------------- /geoclient-parser/src/main/java/gov/nyc/doitt/gis/geoclient/parser/token/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Token package. 19 | * 20 | * @author Matthew Lipper 21 | */ 22 | 23 | package gov.nyc.doitt.gis.geoclient.parser.token; 24 | -------------------------------------------------------------------------------- /geoclient-parser/src/main/java/gov/nyc/doitt/gis/geoclient/parser/util/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Util package. 19 | * 20 | * @author Matthew Lipper 21 | */ 22 | 23 | package gov.nyc.doitt.gis.geoclient.parser.util; 24 | -------------------------------------------------------------------------------- /geoclient-parser/src/main/resources/borough-names.properties: -------------------------------------------------------------------------------- 1 | BK=BROOKLYN 2 | BKLYN=BROOKLYN 3 | BRONX=BRONX 4 | BROOKLYN=BROOKLYN 5 | BX=BRONX 6 | MANHATTAN=MANHATTAN 7 | MN=MANHATTAN 8 | QN=QUEENS 9 | QS=QUEENS 10 | QUEENS=QUEENS 11 | SI=STATEN ISLAND 12 | STATEN\ ISLAND=STATEN ISLAND 13 | STATENIS=STATEN ISLAND 14 | STATENISLAND=STATEN ISLAND 15 | THE\ BRONX=BRONX 16 | 1=MANHATTAN 17 | 2=BRONX 18 | 3=BROOKLYN 19 | 4=QUEENS 20 | 5=STATEN ISLAND -------------------------------------------------------------------------------- /geoclient-parser/src/main/resources/city-names.properties: -------------------------------------------------------------------------------- 1 | ARVERNE=QUEENS 2 | ASTORIA=QUEENS 3 | BAYSIDE=QUEENS 4 | BELLEROSE=QUEENS 5 | BREEZY\ POINT=QUEENS 6 | CAMBRIA\ HEIGHTS=QUEENS 7 | COLLEGE\ POINT=QUEENS 8 | CORONA=QUEENS 9 | EAST\ ELMHURST=QUEENS 10 | ELMHURST=QUEENS 11 | FAR\ ROCKAWAY=QUEENS 12 | FLORAL\ PARK=QUEENS 13 | FLUSHING=QUEENS 14 | FOREST\ HILLS=QUEENS 15 | FRESH\ MEADOWS=QUEENS 16 | GLEN\ OAKS=QUEENS 17 | HOLLIS=QUEENS 18 | HOWARD\ BEACH=QUEENS 19 | INWOOD=QUEENS 20 | JACKSON\ HEIGHTS=QUEENS 21 | JAMAICA=QUEENS 22 | KEW\ GARDENS=QUEENS 23 | LITTLE\ NECK=QUEENS 24 | LONG\ ISLAND\ CITY=QUEENS 25 | MASPETH=QUEENS 26 | MIDDLE\ VILLAGE=QUEENS 27 | NEW\ HYDE\ PARK=QUEENS 28 | NEW\ YORK=MANHATTAN 29 | NEW\ YORK\ CITY=MANHATTAN 30 | N\\.Y\\.C\\.=MANHATTAN 31 | NYC=MANHATTAN 32 | N\\.Y\\.=MANHATTAN 33 | NY=MANHATTAN 34 | OAKLAND\ GARDENS=QUEENS 35 | OZONE\ PARK=QUEENS 36 | QUEENS\ VILLAGE=QUEENS 37 | REGO\ PARK=QUEENS 38 | RICHMOND\ HILL=QUEENS 39 | RIDGEWOOD=QUEENS 40 | ROCKAWAY\ PARK=QUEENS 41 | ROSEDALE=QUEENS 42 | SAINT\ ALBANS=QUEENS 43 | SOUTH\ OZONE\ PARK=QUEENS 44 | SOUTH\ RICHMOND\ HILL=QUEENS 45 | SPRINGFIELD\ GARDENS=QUEENS 46 | SUNNYSIDE=QUEENS 47 | WHITESTONE=QUEENS 48 | WOODHAVEN=QUEENS 49 | WOODSIDE=QUEENS 50 | -------------------------------------------------------------------------------- /geoclient-parser/src/main/resources/regexDataContext.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /geoclient-parser/src/test/java/gov/nyc/doitt/gis/geoclient/parser/regex/AddressParserTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.parser.regex; 17 | 18 | import org.junit.jupiter.api.Test; 19 | import org.slf4j.Logger; 20 | import org.slf4j.LoggerFactory; 21 | 22 | import gov.nyc.doitt.gis.geoclient.parser.AbstractSpecTest; 23 | 24 | public class AddressParserTest extends AbstractSpecTest { 25 | private static final Logger LOGGER = LoggerFactory.getLogger(AddressParserTest.class); 26 | 27 | @Test 28 | public void testAddressParser() { 29 | testParser(new AddressParser(), LOGGER); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /geoclient-parser/src/test/java/gov/nyc/doitt/gis/geoclient/parser/regex/BblParserTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.parser.regex; 17 | 18 | import org.junit.jupiter.api.Test; 19 | import org.slf4j.Logger; 20 | import org.slf4j.LoggerFactory; 21 | 22 | import gov.nyc.doitt.gis.geoclient.parser.AbstractSpecTest; 23 | 24 | public class BblParserTest extends AbstractSpecTest { 25 | private static final Logger LOGGER = LoggerFactory.getLogger(BblParserTest.class); 26 | 27 | @Test 28 | public void testBblParser() { 29 | testParser(new BblParser(), LOGGER); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /geoclient-parser/src/test/java/gov/nyc/doitt/gis/geoclient/parser/regex/BinParserTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.parser.regex; 17 | 18 | import org.junit.jupiter.api.Test; 19 | import org.slf4j.Logger; 20 | import org.slf4j.LoggerFactory; 21 | 22 | import gov.nyc.doitt.gis.geoclient.parser.AbstractSpecTest; 23 | 24 | public class BinParserTest extends AbstractSpecTest { 25 | private static final Logger LOGGER = LoggerFactory.getLogger(BinParserTest.class); 26 | 27 | @Test 28 | public void testBblParser() { 29 | testParser(new BinParser(), LOGGER); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /geoclient-parser/src/test/java/gov/nyc/doitt/gis/geoclient/parser/regex/BlockfaceParserTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.parser.regex; 17 | 18 | import org.junit.jupiter.api.BeforeEach; 19 | import org.junit.jupiter.api.Test; 20 | import org.slf4j.Logger; 21 | import org.slf4j.LoggerFactory; 22 | 23 | import gov.nyc.doitt.gis.geoclient.parser.AbstractSpecTest; 24 | 25 | public class BlockfaceParserTest extends AbstractSpecTest { 26 | private static final Logger LOGGER = LoggerFactory.getLogger(BlockfaceParserTest.class); 27 | private BlockfaceParser parser; 28 | 29 | @BeforeEach 30 | public void setUp() throws Exception { 31 | this.parser = new BlockfaceParser(); 32 | } 33 | 34 | @Test 35 | public void testParse() { 36 | testParser(parser, LOGGER); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /geoclient-parser/src/test/java/gov/nyc/doitt/gis/geoclient/parser/regex/IntersectionParserTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.parser.regex; 17 | 18 | import org.junit.jupiter.api.BeforeEach; 19 | import org.junit.jupiter.api.Test; 20 | import org.slf4j.Logger; 21 | import org.slf4j.LoggerFactory; 22 | 23 | import gov.nyc.doitt.gis.geoclient.parser.AbstractSpecTest; 24 | 25 | public class IntersectionParserTest extends AbstractSpecTest { 26 | private static final Logger LOGGER = LoggerFactory.getLogger(IntersectionParserTest.class); 27 | private IntersectionParser parser; 28 | 29 | @BeforeEach 30 | public void setUp() throws Exception { 31 | parser = new IntersectionParser(); 32 | } 33 | 34 | @Test 35 | public void testParse() { 36 | testParser(this.parser, LOGGER); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /geoclient-parser/src/test/java/gov/nyc/doitt/gis/geoclient/parser/test/UnparsedSpecs.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.parser.test; 17 | 18 | import java.util.ArrayList; 19 | import java.util.List; 20 | 21 | import com.thoughtworks.xstream.annotations.XStreamAlias; 22 | import com.thoughtworks.xstream.annotations.XStreamImplicit; 23 | 24 | @XStreamAlias("specs") 25 | public class UnparsedSpecs { 26 | @XStreamImplicit(itemFieldName = "spec") 27 | private List specs = new ArrayList<>(); 28 | 29 | public List getSpecs() { 30 | return specs; 31 | } 32 | 33 | public void setSpecs(List specs) { 34 | this.specs = specs; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /geoclient-service/doc/deployment-landscape.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CityOfNewYork/geoclient/2aa792c401445f232eb7266efaa43b2cdfc443c3/geoclient-service/doc/deployment-landscape.png -------------------------------------------------------------------------------- /geoclient-service/doc/deployment-portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CityOfNewYork/geoclient/2aa792c401445f232eb7266efaa43b2cdfc443c3/geoclient-service/doc/deployment-portrait.png -------------------------------------------------------------------------------- /geoclient-service/src/main/java/gov/nyc/doitt/gis/geoclient/service/GeoclientBootApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.service; 17 | 18 | import org.springframework.boot.SpringApplication; 19 | import org.springframework.boot.autoconfigure.SpringBootApplication; 20 | import org.springframework.boot.builder.SpringApplicationBuilder; 21 | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; 22 | 23 | @SpringBootApplication 24 | public class GeoclientBootApplication extends SpringBootServletInitializer { 25 | 26 | @Override 27 | protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { 28 | return application.sources(GeoclientBootApplication.class); 29 | } 30 | 31 | public static void main(String[] args) { 32 | SpringApplication.run(GeoclientBootApplication.class, args); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /geoclient-service/src/main/java/gov/nyc/doitt/gis/geoclient/service/configuration/Profiles.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.service.configuration; 17 | 18 | public enum Profiles { 19 | 20 | API_KEY("apikey"); 21 | 22 | private final String value; 23 | 24 | private Profiles(String value) { 25 | this.value = value; 26 | } 27 | 28 | public String value() { 29 | return this.value; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /geoclient-service/src/main/java/gov/nyc/doitt/gis/geoclient/service/configuration/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Configuration package. 19 | * 20 | * @author Matthew Lipper 21 | */ 22 | 23 | package gov.nyc.doitt.gis.geoclient.service.configuration; 24 | -------------------------------------------------------------------------------- /geoclient-service/src/main/java/gov/nyc/doitt/gis/geoclient/service/domain/BadRequest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.service.domain; 17 | 18 | public class BadRequest { 19 | private String httpStatus; 20 | private String message; 21 | private String requestUri; 22 | 23 | public String getRequestUri() { 24 | return requestUri; 25 | } 26 | 27 | public void setRequestUri(String requestUri) { 28 | this.requestUri = requestUri; 29 | } 30 | 31 | public String getHttpStatus() { 32 | return httpStatus; 33 | } 34 | 35 | public void setHttpStatus(String httpStatus) { 36 | this.httpStatus = httpStatus; 37 | } 38 | 39 | public String getMessage() { 40 | return message; 41 | } 42 | 43 | public void setMessage(String message) { 44 | this.message = message; 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /geoclient-service/src/main/java/gov/nyc/doitt/gis/geoclient/service/domain/ServiceType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.service.domain; 17 | 18 | public enum ServiceType { 19 | 20 | ADDRESS("address"), 21 | ADDRESSPOINT("addresspoint"), 22 | BBL("bbl"), 23 | BIN("bin"), 24 | BLOCKFACE("blockface"), 25 | DOC("doc"), 26 | INTERSECTION("intersection"), 27 | NORMALIZE("normalize"), 28 | PLACE("place"), 29 | STREETCODE("streetcode"), 30 | UNKNOWN("unknown"), 31 | VERSION("version"); 32 | 33 | private final String elementName; 34 | 35 | private ServiceType(String elementName) { 36 | this.elementName = elementName; 37 | } 38 | 39 | public String elementName() { 40 | return this.elementName; 41 | } 42 | 43 | @Override 44 | public String toString() { 45 | return this.elementName; 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /geoclient-service/src/main/java/gov/nyc/doitt/gis/geoclient/service/domain/StreetNameFormat.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.service.domain; 17 | 18 | public enum StreetNameFormat { 19 | 20 | SORT("S"), COMPACT("C"); 21 | 22 | private final String elementName; 23 | 24 | private StreetNameFormat(String elementName) { 25 | this.elementName = elementName; 26 | } 27 | 28 | public String elementName() { 29 | return this.elementName; 30 | } 31 | 32 | @Override 33 | public String toString() { 34 | return this.elementName; 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /geoclient-service/src/main/java/gov/nyc/doitt/gis/geoclient/service/domain/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Domain package. 19 | * 20 | * @author Matthew Lipper 21 | */ 22 | 23 | package gov.nyc.doitt.gis.geoclient.service.domain; 24 | -------------------------------------------------------------------------------- /geoclient-service/src/main/java/gov/nyc/doitt/gis/geoclient/service/invoker/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Invoker package. 19 | * 20 | * @author Matthew Lipper 21 | */ 22 | 23 | package gov.nyc.doitt.gis.geoclient.service.invoker; 24 | -------------------------------------------------------------------------------- /geoclient-service/src/main/java/gov/nyc/doitt/gis/geoclient/service/mapper/Mapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.service.mapper; 17 | 18 | import java.util.Map; 19 | 20 | public interface Mapper { 21 | 22 | T fromParameters(Map source, Class destinationClass) throws MappingException; 23 | 24 | T fromParameters(Map source, T destination) throws MappingException; 25 | 26 | Map toParameters(T source, Map destination) throws MappingException; 27 | 28 | Map toParameters(T source) throws MappingException; 29 | } 30 | -------------------------------------------------------------------------------- /geoclient-service/src/main/java/gov/nyc/doitt/gis/geoclient/service/mapper/MappingException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.service.mapper; 17 | 18 | public class MappingException extends RuntimeException { 19 | 20 | private static final long serialVersionUID = -8294913337317033662L; 21 | 22 | public MappingException(String message) { 23 | super(message); 24 | } 25 | 26 | public MappingException(String message, Throwable cause) { 27 | super(message, cause); 28 | } 29 | 30 | public MappingException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { 31 | super(message, cause, enableSuppression, writableStackTrace); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /geoclient-service/src/main/java/gov/nyc/doitt/gis/geoclient/service/mapper/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Mapper package. 19 | * 20 | * @author Matthew Lipper 21 | */ 22 | 23 | package gov.nyc.doitt.gis.geoclient.service.mapper; 24 | -------------------------------------------------------------------------------- /geoclient-service/src/main/java/gov/nyc/doitt/gis/geoclient/service/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Top-level geoclient-service package. 19 | * 20 | * @author Matthew Lipper 21 | */ 22 | 23 | package gov.nyc.doitt.gis.geoclient.service; 24 | -------------------------------------------------------------------------------- /geoclient-service/src/main/java/gov/nyc/doitt/gis/geoclient/service/sanitizer/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Implementation of user request input string sanitizer. 19 | * 20 | * @author Matthew Lipper 21 | */ 22 | 23 | package gov.nyc.doitt.gis.geoclient.service.sanitizer; 24 | -------------------------------------------------------------------------------- /geoclient-service/src/main/java/gov/nyc/doitt/gis/geoclient/service/search/SearchId.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.service.search; 17 | 18 | import java.util.Date; 19 | import java.util.concurrent.atomic.AtomicLong; 20 | 21 | public class SearchId { 22 | private final String prefix; 23 | private final AtomicLong sequence; 24 | 25 | public SearchId(String prefix) { 26 | super(); 27 | this.prefix = prefix; 28 | this.sequence = new AtomicLong(0); 29 | } 30 | 31 | public String next() { 32 | return String.format("%s-%d-%d", prefix, sequence.incrementAndGet(), new Date().getTime()); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /geoclient-service/src/main/java/gov/nyc/doitt/gis/geoclient/service/search/ValueSource.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.service.search; 17 | 18 | public enum ValueSource { 19 | ASSIGNED, MAPPED, PARSED 20 | } 21 | -------------------------------------------------------------------------------- /geoclient-service/src/main/java/gov/nyc/doitt/gis/geoclient/service/search/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Search package. 19 | * 20 | * @author Matthew Lipper 21 | */ 22 | 23 | package gov.nyc.doitt.gis.geoclient.service.search; 24 | -------------------------------------------------------------------------------- /geoclient-service/src/main/java/gov/nyc/doitt/gis/geoclient/service/search/policy/AbstractPolicy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.service.search.policy; 17 | 18 | public abstract class AbstractPolicy implements Policy { 19 | 20 | // TODO TESTME 21 | @Override 22 | public String getName() { 23 | return getClass().getSimpleName(); 24 | } 25 | 26 | @Override 27 | public abstract String getDescription(); 28 | } 29 | -------------------------------------------------------------------------------- /geoclient-service/src/main/java/gov/nyc/doitt/gis/geoclient/service/search/policy/ExactMatchPolicy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.service.search.policy; 17 | 18 | import gov.nyc.doitt.gis.geoclient.service.search.Search; 19 | import gov.nyc.doitt.gis.geoclient.service.search.SearchResult; 20 | 21 | public interface ExactMatchPolicy extends Policy { 22 | Search findExactMatch(SearchResult searchResult); 23 | } 24 | -------------------------------------------------------------------------------- /geoclient-service/src/main/java/gov/nyc/doitt/gis/geoclient/service/search/policy/Policy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.service.search.policy; 17 | 18 | public interface Policy { 19 | String getName(); 20 | 21 | String getDescription(); 22 | } 23 | -------------------------------------------------------------------------------- /geoclient-service/src/main/java/gov/nyc/doitt/gis/geoclient/service/search/policy/SearchDepthPolicy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.service.search.policy; 17 | 18 | import java.util.List; 19 | 20 | import gov.nyc.doitt.gis.geoclient.service.search.Search; 21 | import gov.nyc.doitt.gis.geoclient.service.search.SearchResult; 22 | 23 | public interface SearchDepthPolicy extends Policy { 24 | List inputForSubSearches(SearchResult searchResult); 25 | } 26 | -------------------------------------------------------------------------------- /geoclient-service/src/main/java/gov/nyc/doitt/gis/geoclient/service/search/policy/SimilarNamesPolicy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.service.search.policy; 17 | 18 | public interface SimilarNamesPolicy extends Policy { 19 | boolean isSimilarName(String original, String proposed); 20 | } 21 | -------------------------------------------------------------------------------- /geoclient-service/src/main/java/gov/nyc/doitt/gis/geoclient/service/search/policy/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Policy package. 19 | * 20 | * @author Matthew Lipper 21 | */ 22 | 23 | package gov.nyc.doitt.gis.geoclient.service.search.policy; 24 | -------------------------------------------------------------------------------- /geoclient-service/src/main/java/gov/nyc/doitt/gis/geoclient/service/search/request/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Request package. 19 | * 20 | * @author Matthew Lipper 21 | */ 22 | 23 | package gov.nyc.doitt.gis.geoclient.service.search.request; 24 | -------------------------------------------------------------------------------- /geoclient-service/src/main/java/gov/nyc/doitt/gis/geoclient/service/search/task/InitialSearchTaskBuilder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.service.search.task; 17 | 18 | import java.util.List; 19 | 20 | import gov.nyc.doitt.gis.geoclient.parser.LocationTokens; 21 | import gov.nyc.doitt.gis.geoclient.service.search.policy.SearchPolicy; 22 | 23 | public interface InitialSearchTaskBuilder { 24 | List getSearchTasks(SearchPolicy searchPolicy, LocationTokens locationTokens); 25 | } 26 | -------------------------------------------------------------------------------- /geoclient-service/src/main/java/gov/nyc/doitt/gis/geoclient/service/search/task/SpawnedSearchTaskBuilder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.service.search.task; 17 | 18 | import java.util.List; 19 | 20 | import gov.nyc.doitt.gis.geoclient.service.search.SearchResult; 21 | 22 | public interface SpawnedSearchTaskBuilder { 23 | List getSearchTasks(SearchResult searchResult); 24 | } 25 | -------------------------------------------------------------------------------- /geoclient-service/src/main/java/gov/nyc/doitt/gis/geoclient/service/search/task/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Task package. 19 | * 20 | * @author Matthew Lipper 21 | */ 22 | 23 | package gov.nyc.doitt.gis.geoclient.service.search.task; 24 | -------------------------------------------------------------------------------- /geoclient-service/src/main/java/gov/nyc/doitt/gis/geoclient/service/search/web/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Web package. 19 | * 20 | * @author Matthew Lipper 21 | */ 22 | 23 | package gov.nyc.doitt.gis.geoclient.service.search.web; 24 | -------------------------------------------------------------------------------- /geoclient-service/src/main/java/gov/nyc/doitt/gis/geoclient/service/search/web/response/MatchStatus.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.service.search.web.response; 17 | 18 | public enum MatchStatus { 19 | EXACT_MATCH, POSSIBLE_MATCH, REJECTED 20 | } 21 | -------------------------------------------------------------------------------- /geoclient-service/src/main/java/gov/nyc/doitt/gis/geoclient/service/search/web/response/ParamsAndResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.service.search.web.response; 17 | 18 | import gov.nyc.doitt.gis.geoclient.service.search.SearchResult; 19 | 20 | public class ParamsAndResult { 21 | private final SearchParameters searchParameters; 22 | private final SearchResult searchResult; 23 | 24 | public ParamsAndResult(SearchParameters searchParameters, SearchResult searchResult) { 25 | super(); 26 | this.searchParameters = searchParameters; 27 | this.searchResult = searchResult; 28 | } 29 | 30 | public SearchParameters getSearchParameters() { 31 | return searchParameters; 32 | } 33 | 34 | public SearchResult getSearchResult() { 35 | return searchResult; 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /geoclient-service/src/main/java/gov/nyc/doitt/gis/geoclient/service/search/web/response/ParseTree.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.service.search.web.response; 17 | 18 | import java.util.List; 19 | 20 | import gov.nyc.doitt.gis.geoclient.parser.token.Chunk; 21 | 22 | public class ParseTree { 23 | 24 | private List chunks; 25 | 26 | public List getChunks() { 27 | return chunks; 28 | } 29 | 30 | public void setChunks(List chunks) { 31 | this.chunks = chunks; 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /geoclient-service/src/main/java/gov/nyc/doitt/gis/geoclient/service/search/web/response/PolicySummary.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.service.search.web.response; 17 | 18 | public class PolicySummary { 19 | private String name; 20 | private String description; 21 | public String getName() { 22 | return name; 23 | } 24 | 25 | public void setName(String name) { 26 | this.name = name; 27 | } 28 | 29 | public String getDescription() { 30 | return description; 31 | } 32 | 33 | public void setDescription(String description) { 34 | this.description = description; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /geoclient-service/src/main/java/gov/nyc/doitt/gis/geoclient/service/search/web/response/Status.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.service.search.web.response; 17 | 18 | public enum Status { 19 | OK, REJECTED 20 | } 21 | -------------------------------------------------------------------------------- /geoclient-service/src/main/java/gov/nyc/doitt/gis/geoclient/service/search/web/response/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Response package. 19 | * 20 | * @author Matthew Lipper 21 | */ 22 | 23 | package gov.nyc.doitt.gis.geoclient.service.search.web.response; 24 | -------------------------------------------------------------------------------- /geoclient-service/src/main/java/gov/nyc/doitt/gis/geoclient/service/street/web/StreetCodeConverter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.service.street.web; 17 | 18 | import org.springframework.core.convert.converter.Converter; 19 | import org.springframework.lang.NonNull; 20 | 21 | import gov.nyc.doitt.gis.geoclient.api.StreetCode; 22 | 23 | /** 24 | * Converts between string representations of street codes in request parameters 25 | * to {@link StreetCode} arguments. 26 | * 27 | * @author mlipper 28 | * @since 2.0 29 | */ 30 | public class StreetCodeConverter implements Converter { 31 | 32 | @Override 33 | public StreetCode convert(@NonNull String source) { 34 | return null; 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /geoclient-service/src/main/java/gov/nyc/doitt/gis/geoclient/service/street/web/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Street service web classes. 19 | * @author mlipper 20 | */ 21 | 22 | package gov.nyc.doitt.gis.geoclient.service.street.web; 23 | -------------------------------------------------------------------------------- /geoclient-service/src/main/java/gov/nyc/doitt/gis/geoclient/service/web/MissingAnyOfOptionalServletRequestParametersException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.service.web; 17 | 18 | import org.apache.commons.lang3.StringUtils; 19 | import org.springframework.web.bind.ServletRequestBindingException; 20 | 21 | public class MissingAnyOfOptionalServletRequestParametersException extends ServletRequestBindingException { 22 | private static final long serialVersionUID = -3313087188951029600L; 23 | private final String[] parameters; 24 | public MissingAnyOfOptionalServletRequestParametersException(String... parameters) { 25 | super(""); 26 | this.parameters = parameters; 27 | } 28 | 29 | @Override 30 | public String getMessage() { 31 | return String.format("This operation requires one of the following parameters: %s", 32 | StringUtils.join(parameters)); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /geoclient-service/src/main/java/gov/nyc/doitt/gis/geoclient/service/web/ViewHelper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.service.web; 17 | 18 | public class ViewHelper { 19 | 20 | public String sectionAnchor(int section, int subsection) { 21 | return String.format("section-%s", sectionNumber(section, subsection)); 22 | } 23 | 24 | public String sectionNumber(int section, int subsection) { 25 | return String.format("%d.%d", section, subsection); 26 | } 27 | 28 | public String href(String id) { 29 | if (id != null && id.toLowerCase().matches("^https?://.*")) { 30 | return id; 31 | } 32 | return String.format("#%s", id); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /geoclient-service/src/main/java/gov/nyc/doitt/gis/geoclient/service/web/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Web package. 19 | * 20 | * @author Matthew Lipper 21 | */ 22 | 23 | package gov.nyc.doitt.gis.geoclient.service.web; 24 | -------------------------------------------------------------------------------- /geoclient-service/src/main/java/gov/nyc/doitt/gis/geoclient/service/xstream/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Xstream package. 19 | * 20 | * @author Matthew Lipper 21 | */ 22 | 23 | package gov.nyc.doitt.gis.geoclient.service.xstream; 24 | -------------------------------------------------------------------------------- /geoclient-service/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | 2 | _ _ _ ____ 3 | __ _ ___ ___ ___| (_) ___ _ __ | |_ __ _|___ \ 4 | / _` |/ _ \/ _ \ / __| | |/ _ \ '_ \| __| \ \ / / __) | 5 | | (_| | __/ (_) | (__| | | __/ | | | |_ \ V / / __/ 6 | \__, |\___|\___/ \___|_|_|\___|_| |_|\__| \_/ |_____| 7 | |___/ 8 | -------------------------------------------------------------------------------- /geoclient-service/src/main/resources/static/images/arrow-down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CityOfNewYork/geoclient/2aa792c401445f232eb7266efaa43b2cdfc443c3/geoclient-service/src/main/resources/static/images/arrow-down.png -------------------------------------------------------------------------------- /geoclient-service/src/main/resources/static/images/new.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CityOfNewYork/geoclient/2aa792c401445f232eb7266efaa43b2cdfc443c3/geoclient-service/src/main/resources/static/images/new.jpg -------------------------------------------------------------------------------- /geoclient-service/src/main/resources/static/images/octocat-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CityOfNewYork/geoclient/2aa792c401445f232eb7266efaa43b2cdfc443c3/geoclient-service/src/main/resources/static/images/octocat-small.png -------------------------------------------------------------------------------- /geoclient-service/src/main/resources/static/js/scale.fix.js: -------------------------------------------------------------------------------- 1 | fixScale = function(doc) { 2 | 3 | var addEvent = 'addEventListener', 4 | type = 'gesturestart', 5 | qsa = 'querySelectorAll', 6 | scales = [1, 1], 7 | meta = qsa in doc ? doc[qsa]('meta[name=viewport]') : []; 8 | 9 | function fix() { 10 | meta.content = 'width=device-width,minimum-scale=' + scales[0] + ',maximum-scale=' + scales[1]; 11 | doc.removeEventListener(type, fix, true); 12 | } 13 | 14 | if ((meta = meta[meta.length - 1]) && addEvent in doc) { 15 | fix(); 16 | scales = [.25, 1.6]; 17 | doc[addEvent](type, fix, true); 18 | } 19 | 20 | }; -------------------------------------------------------------------------------- /geoclient-service/src/test/java/gov/nyc/doitt/gis/geoclient/service/configuration/ProfilesTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.service.configuration; 17 | 18 | import static org.junit.jupiter.api.Assertions.assertEquals; 19 | 20 | import org.junit.jupiter.api.Test; 21 | 22 | public class ProfilesTest { 23 | 24 | @Test 25 | public void testValue() { 26 | assertEquals("apikey", Profiles.API_KEY.value()); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /geoclient-service/src/test/java/gov/nyc/doitt/gis/geoclient/service/mapper/Cat.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.service.mapper; 17 | 18 | public class Cat { 19 | private String name; 20 | 21 | public String getName() { 22 | return name; 23 | } 24 | 25 | public void setName(String name) { 26 | this.name = name; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /geoclient-service/src/test/java/gov/nyc/doitt/gis/geoclient/service/mapper/CatMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.service.mapper; 17 | 18 | import java.util.Map; 19 | 20 | class CatMapper extends AbstractParameterMapper { 21 | 22 | @Override 23 | public Cat fromParameters(Map source, Cat destination) throws MappingException { 24 | String name = (String) source.get("name"); 25 | destination.setName(name); 26 | return destination; 27 | } 28 | 29 | @Override 30 | public Map toParameters(Cat source, Map destination) throws MappingException { 31 | destination.put("name", source.getName()); 32 | return destination; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /geoclient-service/src/test/java/gov/nyc/doitt/gis/geoclient/service/mapper/Dog.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.service.mapper; 17 | 18 | public class Dog { 19 | private String name; 20 | 21 | public String getName() { 22 | return name; 23 | } 24 | 25 | public void setName(String name) { 26 | this.name = name; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /geoclient-service/src/test/java/gov/nyc/doitt/gis/geoclient/service/mapper/DogMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.service.mapper; 17 | 18 | import java.util.Map; 19 | 20 | class DogMapper extends AbstractParameterMapper { 21 | 22 | @Override 23 | public Dog fromParameters(Map source, Dog destination) throws MappingException { 24 | String name = (String) source.get("name"); 25 | destination.setName(name); 26 | return destination; 27 | } 28 | 29 | @Override 30 | public Map toParameters(Dog source, Map destination) throws MappingException { 31 | destination.put("name", source.getName()); 32 | return destination; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /geoclient-service/src/test/java/gov/nyc/doitt/gis/geoclient/service/search/SearchIdTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.service.search; 17 | 18 | import static org.assertj.core.api.Assertions.assertThat; 19 | 20 | import org.junit.jupiter.api.Test; 21 | 22 | public class SearchIdTest { 23 | 24 | @Test 25 | public void testNext() { 26 | String prefix = "xyz"; 27 | SearchId id = new SearchId(prefix); 28 | assertThat(id.next().contains(prefix)); 29 | assertThat(id.next()).isNotEqualTo(id.next()); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /geoclient-service/src/test/java/gov/nyc/doitt/gis/geoclient/service/search/policy/SearchPolicyTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.service.search.policy; 17 | 18 | import static org.assertj.core.api.Assertions.assertThat; 19 | 20 | import org.junit.jupiter.api.Test; 21 | 22 | public class SearchPolicyTest { 23 | @Test 24 | public void testDefaultSettings() { 25 | SearchPolicy searchPolicy = new SearchPolicy(); 26 | assertThat(searchPolicy.getExactMatchPolicy()).isInstanceOf(DefaultExactMatchPolicy.class); 27 | assertThat(searchPolicy.getSearchDepthPolicy()).isInstanceOf(DefaultSearchDepthPolicy.class); 28 | assertThat(searchPolicy.getSimilarNamesPolicy()).isInstanceOf(DefaultSimilarNamesPolicy.class); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /geoclient-service/src/test/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 6 | 7 | 8 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /geoclient-test/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'geoclient.library-conventions' 3 | id 'geoclient.test-conventions' 4 | } 5 | 6 | dependencies { 7 | // Version specified by catalog platform libs.junit-bom 8 | implementation 'org.junit.jupiter:junit-jupiter-api' 9 | } 10 | 11 | tasks.named('test', Test) { 12 | environment('GEOCLIENT_SERVICE_STATUS', 'running') 13 | systemProperty('geoclient.service.status', 'running') 14 | } -------------------------------------------------------------------------------- /geoclient-test/src/data/address.csv: -------------------------------------------------------------------------------- 1 | houseNumber,street,borough,app_key,app_id 2 | 314,W 100 ST,Manhattan,ABCDEF,gis-itest 3 | 4 | -------------------------------------------------------------------------------- /geoclient-test/src/data/geosupport-18d_18.4.csv: -------------------------------------------------------------------------------- 1 | functions,borough,houseNumber,street,out_rc,out_houseNumber,out_street,out_borough 2 | 1/1E/1B/1A/AP,1,ONE,BRYANT PARK,00,1,BRYANT PARK,1 3 | 1/1E/1B/1A/AP,1,,ONE BRYANT PARK,00,,ONE BRYANT PARK,1 4 | 1/1E/1B/1A/AP,1,TWO,WORLD TRADE CENTER,00,2,WORLD TRADE CENTER,1 5 | 1/1E/1B/1A/AP,1,FOUR,WORLD TRADE CENTER,00,4,WORLD TRADE CENTER,1 6 | 1/1E/1B,3,165 BA,QUINCY STREET,00,165 BA,QUINCY STREET,3 7 | 1/1E/1B,5,2B GAR,TAYLOR COURT,00,2 B GARAGE,TAYLOR COURT,5 8 | 1/1E/1B,5,4 A GARAGE,TAYLOR COURT,00,4 A GARAGE,TAYLOR COURT,5 9 | -------------------------------------------------------------------------------- /geoclient-test/src/main/java/gov/nyc/doitt/gis/geoclient/test/NativeIntegrationTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.test; 17 | 18 | import static java.lang.annotation.ElementType.METHOD; 19 | import static java.lang.annotation.ElementType.TYPE; 20 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 21 | 22 | import java.lang.annotation.Documented; 23 | import java.lang.annotation.Retention; 24 | import java.lang.annotation.Target; 25 | 26 | import org.junit.jupiter.api.Tag; 27 | 28 | @Retention(RUNTIME) 29 | @Target({ TYPE, METHOD }) 30 | @Documented 31 | @Tag("jni") 32 | /** 33 | * Annotation indicating that the type or method will require a working 34 | * JNI configuration to Geosupport. 35 | * 36 | * Composed with the {@code JUnit 5} annotation {@link Tag} class and configured 37 | * with: @Tag("jni") 38 | * 39 | * @author mlipper 40 | * 41 | */ 42 | public @interface NativeIntegrationTest { 43 | 44 | } 45 | -------------------------------------------------------------------------------- /geoclient-test/src/main/java/gov/nyc/doitt/gis/geoclient/test/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Testing utilities. 19 | * 20 | * @author Matthew Lipper 21 | */ 22 | 23 | package gov.nyc.doitt.gis.geoclient.test; 24 | -------------------------------------------------------------------------------- /geoclient-test/src/test/java/gov/nyc/doitt/gis/geoclient/test/RequiresRestServiceCustomConditionTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.test; 17 | 18 | import static org.junit.jupiter.api.Assertions.assertTrue; 19 | 20 | import org.junit.jupiter.api.Test; 21 | 22 | /** 23 | * Wonky test for RequiresRestServiceCustomCondition. 24 | * 25 | * @author mlipper 26 | * @since 2.0 27 | */ 28 | public class RequiresRestServiceCustomConditionTest { 29 | 30 | @Test 31 | void test_restServiceRunning_isTrue() { 32 | assertTrue(RequiresRestServiceCustomCondtion.restServiceRunning()); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /geoclient-utils/cli/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'application' 3 | id 'geoclient.java-conventions' 4 | } 5 | 6 | dependencies { 7 | implementation project(':geoclient-utils:jni-test') 8 | implementation project(':geoclient-jni') 9 | } 10 | 11 | application { 12 | //applicationDefaultJvmArgs = ['-Xcheck:jni'] 13 | mainClass = 'gov.nyc.doitt.gis.geoclient.cli.JniTest' 14 | } 15 | 16 | // 17 | // To run the app with arguments to the main method use --args="...". 18 | // 19 | // Example: see the usage message. 20 | // 21 | // ./gradlew :geoclient-utils:cli:run --args="--help" 22 | // 23 | // Example: run from the project root and use the :geoclient-utils:jni-test 24 | // project's jni-test.conf file. 25 | // 26 | // ./gradlew :g-u:cli:run --args="--file=$(pwd)/geoclient-utils/jni-test/src/main/resources/jni-test.conf" 27 | // 28 | // See: 29 | // https://docs.gradle.org/current/userguide/application_plugin.html#application_plugin 30 | // -------------------------------------------------------------------------------- /geoclient-utils/cli/src/main/java/gov/nyc/doitt/gis/geoclient/cli/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Java application for testing the {@code geoclient-jni} project from 19 | * the command line. 20 | * 21 | * @author Matthew Lipper 22 | * 23 | * @since 1.0 24 | */ 25 | 26 | package gov.nyc.doitt.gis.geoclient.cli; 27 | -------------------------------------------------------------------------------- /geoclient-utils/jni-test/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'geoclient.library-conventions' 3 | } 4 | 5 | dependencies { 6 | } 7 | 8 | -------------------------------------------------------------------------------- /geoclient-utils/jni-test/src/main/java/gov/nyc/doitt/gis/geoclient/jni/test/TestConfigurationException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package gov.nyc.doitt.gis.geoclient.jni.test; 17 | 18 | /** 19 | * 20 | * Extends {@link RuntimeException} and indicates a problem with the creation of 21 | * {@link TestConfig} instances. 22 | * 23 | * @author mlipper 24 | * 25 | */ 26 | public class TestConfigurationException extends RuntimeException { 27 | 28 | /** 29 | * Generated serialVersionId. 30 | */ 31 | private static final long serialVersionUID = -3864318281523561115L; 32 | 33 | /** 34 | * Creates a new {@link TestConfigurationException}. 35 | * 36 | * @param message describing the problem 37 | */ 38 | public TestConfigurationException(String message) { 39 | super(message); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /geoclient-utils/jni-test/src/main/java/gov/nyc/doitt/gis/geoclient/jni/test/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Classes and utilities for creating function calls (WA1) from a 19 | * configuration file. Useful for testing the the {@code geoclient-jni} 20 | * project directly. 21 | * 22 | * @author Matthew Lipper 23 | * 24 | * @since 1.0 25 | */ 26 | 27 | package gov.nyc.doitt.gis.geoclient.jni.test; 28 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | version=2.0.1-rc.2 2 | group=gov.nyc.doitt.gis.geoclient 3 | 4 | # (auto|plain|rich|verbose) 5 | org.gradle.console=auto 6 | #org.gradle.debug=true 7 | #org.gradle.daemon=false 8 | #org.gradle.jvmargs=-verbose:jni 9 | # (quiet,warn,lifecycle,info,debug) 10 | #org.gradle.logging.level=lifecycle 11 | #org.gradle.vfs.watch=true 12 | # (all,none,summary) 13 | org.gradle.warning.mode=all 14 | 15 | # 16 | # Useful for running bootRun or integrationTest. 17 | # 18 | # By default, geoclient-jni runtime native libs are unpacked from the 19 | # geoclient-jni jar to ${java.tmpdir}/${gc.jni.version} 20 | # 21 | systemProp.gc.jni.version=geoclient-jni-2 -------------------------------------------------------------------------------- /gradle/config/checkstyle/checkstyle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /gradle/config/checkstyle/suppressions.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /gradle/config/eclipse/geoclient-eclipse.importorder: -------------------------------------------------------------------------------- 1 | #Organize Import Order 2 | 0=java 3 | 1=javax 4 | 2=jdk 5 | 3=aQute 6 | 4=junit 7 | 5=de 8 | 6=com 9 | 7=example 10 | 8=extensions 11 | 9=io 12 | 10=org 13 | -------------------------------------------------------------------------------- /gradle/config/spotless/apache-license-2.0.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-$YEAR the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CityOfNewYork/geoclient/2aa792c401445f232eb7266efaa43b2cdfc443c3/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /images/.env: -------------------------------------------------------------------------------- 1 | GEOCLIENT_IMAGE=geoclient:latest-run 2 | GEOSUPPORT_VOLUME=geosupport-latest 3 | -------------------------------------------------------------------------------- /images/compose.yaml: -------------------------------------------------------------------------------- 1 | services: 2 | geoclient: 3 | # Assumes run.Dockerfile has been built, tagged and pushed to 4 | # an accessible registry. 5 | image: ${GEOCLIENT_IMAGE} 6 | container_name: geoclient 7 | ports: 8 | - 8080:8080 9 | volumes: 10 | - geosupport-data:/opt/geosupport 11 | environment: 12 | - GEOSUPPORT_BASE=/opt/geosupport 13 | - GEOSUPPORT_HOME=/opt/geosupport/current 14 | - GEOFILES=/opt/geosupport/current/fls/ 15 | volumes: 16 | geosupport-data: 17 | # Assumes .env file or environment variable is defined with name of an 18 | # existing Docker volume prep-populated with Geosupport. 19 | name: ${GEOSUPPORT_VOLUME} 20 | 21 | -------------------------------------------------------------------------------- /images/run.Dockerfile: -------------------------------------------------------------------------------- 1 | # syntax=docker/dockerfile:1 2 | 3 | FROM eclipse-temurin:17-jre AS builder 4 | 5 | # Default for JARFILE assumes Docker context is the root project directory. 6 | ARG JARFILE 7 | ENV JARFILE="${JARFILE:-./geoclient-service/build/libs/geoclient.jar}" 8 | 9 | WORKDIR /app 10 | COPY "${JARFILE}" . 11 | COPY --chmod=755 images/run.sh . 12 | 13 | RUN set -ex \ 14 | && java -Djarmode=layertools -jar ./geoclient.jar extract 15 | 16 | FROM eclipse-temurin:17-jre 17 | 18 | WORKDIR /app 19 | COPY --from=builder app/run.sh . 20 | COPY --from=builder app/dependencies/ ./ 21 | COPY --from=builder app/spring-boot-loader/ ./ 22 | COPY --from=builder app/snapshot-dependencies/ ./ 23 | COPY --from=builder app/application/ ./ 24 | 25 | # Assumes a Geosupport installation has been mounted to /opt/geosupport. 26 | ENV GEOSUPPORT_BASEDIR=/opt/geosupport 27 | ENV GEOSUPPORT_HOME="${GEOSUPPORT_BASEDIR}/current" 28 | ENV GEOFILES="${GEOSUPPORT_BASEDIR}/current/fls/" 29 | 30 | ENTRYPOINT ["/app/run.sh"] 31 | EXPOSE 8080 -------------------------------------------------------------------------------- /images/run.Dockerfile.dockerignore: -------------------------------------------------------------------------------- 1 | **/.DS_Store 2 | **/.dockerignore 3 | **/.env 4 | **/.git 5 | **/.gitignore 6 | **/.gradle 7 | **/.local 8 | **/.vscode 9 | **/bin 10 | **/build 11 | !**/build/libs/geoclient-service-* 12 | !**/build/libs/geoclient.jar 13 | **/build/libs/*-javadoc.jar 14 | **/build/libs/*-plain.jar 15 | **/build/libs/*-sources.jar 16 | **/docker-compose* 17 | **/compose* 18 | **/Dockerfile* 19 | **/secrets.dev.yaml 20 | **/values.dev.yaml -------------------------------------------------------------------------------- /images/run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -eux 4 | 5 | "${GEOSUPPORT_HOME}/bin/geosupport" install 6 | 7 | exec java -Dspring.profiles.active=default \ 8 | org.springframework.boot.loader.launch.JarLauncher 9 | 10 | -------------------------------------------------------------------------------- /manifests/base/properties/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | 4 | configMapGenerator: 5 | - name: pipeline-variables 6 | envs: 7 | - pipeline.env -------------------------------------------------------------------------------- /manifests/base/properties/pipeline.env: -------------------------------------------------------------------------------- 1 | # The value of COLOR must match value of col label in: 2 | # base/resources/kustomization.yaml 3 | COLOR=green 4 | ENVIRONMENT=all 5 | PVC_NAME=pvc-geosupport-01 6 | SVC_PORT=80 7 | -------------------------------------------------------------------------------- /manifests/base/resources/hpa.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: autoscaling/v2 2 | kind: HorizontalPodAutoscaler 3 | metadata: 4 | labels: 5 | app: geoclient-v2 6 | col: COLOR 7 | environment: ENVIRONMENT 8 | name: geoclient-v2 # Append -COLOR 9 | #namespace: gis-apps 10 | spec: 11 | maxReplicas: -1 # HPA_MAX_REPLICAS 12 | metrics: 13 | - resource: 14 | name: cpu 15 | target: 16 | averageUtilization: -1 # HPA_AVG_UTILIZATION 17 | type: Utilization 18 | type: Resource 19 | minReplicas: -1 # HPA_MIN_REPLICAS 20 | scaleTargetRef: 21 | apiVersion: apps/v1 22 | kind: Deployment 23 | name: geoclient-v2 # Append -COLOR 24 | -------------------------------------------------------------------------------- /manifests/base/resources/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | 4 | resources: 5 | - ../properties 6 | - deployment.yaml 7 | - service.yaml 8 | - hpa.yaml 9 | 10 | configMapGenerator: 11 | - name: pipeline-variables 12 | envs: 13 | - pipeline.env 14 | behavior: merge 15 | - name: runtime-environment 16 | envs: 17 | - runtime.env 18 | 19 | images: 20 | - name: docker.io/mlipper/geosupport-docker 21 | newTag: 2.0.19 22 | - name: docker.io/mlipper/geoclient 23 | newTag: 2.0.1-rc.2 24 | 25 | namespace: gis-apps 26 | 27 | labels: 28 | - pairs: 29 | app: geoclient-v2 30 | # The value of col label must match value of COLOR 31 | # in base/properties/pipeline.env 32 | col: green 33 | includeSelectors: true 34 | includeTemplates: true 35 | 36 | replacements: 37 | - path: replacement.yaml 38 | -------------------------------------------------------------------------------- /manifests/base/resources/pipeline.env: -------------------------------------------------------------------------------- 1 | ## 2 | # Set in: base/properties/pipeline.env 3 | # COLOR= 4 | # PVC_NAME= 5 | # SVC_PORT= **see below 6 | # 7 | # Set in either: 8 | # components/minikube/pipeline.env 9 | # or 10 | # components/development/pipeline.env 11 | # or 12 | # components/production/pipeline.env 13 | # ING_HOST= **see below 14 | # 15 | # ** 16 | # **Does not apply to minikube environment 17 | ## 18 | HPA_AVG_UTILIZATION=200 19 | HPA_MAX_REPLICAS=6 20 | HPA_MIN_REPLICAS=3 21 | SVC_TARGET_PORT=8080 22 | SVC_TYPE=ClusterIP -------------------------------------------------------------------------------- /manifests/base/resources/runtime.env: -------------------------------------------------------------------------------- 1 | GEOSUPPORT_FULLVERSION=24c1_24.3 2 | GEOSUPPORT_HOME=/opt/geosupport/current 3 | GEOFILES=/opt/geosupport/current/fls/ 4 | -------------------------------------------------------------------------------- /manifests/base/resources/service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | labels: 5 | app: geoclient-v2 6 | col: COLOR 7 | environment: ENVIRONMENT 8 | name: geoclient-v2 # Append -COLOR 9 | #namespace: gis-apps 10 | spec: 11 | ports: 12 | - port: -1 # SVC_PORT 13 | targetPort: -1 # SVC_TARGET_PORT 14 | selector: 15 | app: geoclient-v2 16 | col: COLOR 17 | type: SVC_TYPE 18 | -------------------------------------------------------------------------------- /manifests/components/development/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1alpha1 2 | kind: Component 3 | 4 | configMapGenerator: 5 | - name: pipeline-variables 6 | behavior: merge 7 | envs: 8 | - pipeline.env 9 | 10 | namespace: gis-apps 11 | 12 | replacements: 13 | - path: replacement.yaml 14 | -------------------------------------------------------------------------------- /manifests/components/development/pipeline.env: -------------------------------------------------------------------------------- 1 | ENVIRONMENT=development 2 | ING_HOST=geoclient-dev.nyc.gov -------------------------------------------------------------------------------- /manifests/components/development/replacement.yaml: -------------------------------------------------------------------------------- 1 | - source: 2 | kind: ConfigMap 3 | name: pipeline-variables 4 | fieldPath: data.ENVIRONMENT 5 | targets: 6 | - select: 7 | kind: Deployment 8 | fieldPaths: 9 | - metadata.labels.environment 10 | - select: 11 | kind: HorizontalPodAutoscaler 12 | fieldPaths: 13 | - metadata.labels.environment 14 | - select: 15 | kind: Service 16 | fieldPaths: 17 | - metadata.labels.environment -------------------------------------------------------------------------------- /manifests/components/minikube/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1alpha1 2 | kind: Component 3 | 4 | configMapGenerator: 5 | - name: pipeline-variables 6 | behavior: merge 7 | envs: 8 | - pipeline.env 9 | 10 | namespace: gis-apps 11 | 12 | replacements: 13 | - path: replacement.yaml 14 | -------------------------------------------------------------------------------- /manifests/components/minikube/pipeline.env: -------------------------------------------------------------------------------- 1 | ENVIRONMENT=minikube 2 | HPA_AVG_UTILIZATION=200 3 | HPA_MAX_REPLICAS=2 4 | HPA_MIN_REPLICAS=1 5 | ING_HOST=127.0.0.1 6 | SVC_PORT=8080 7 | SVC_TARGET_PORT=8080 8 | SVC_TYPE=NodePort -------------------------------------------------------------------------------- /manifests/components/production/ingress-patch.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.k8s.io/v1 2 | kind: Ingress 3 | metadata: 4 | labels: 5 | environment: production 6 | -------------------------------------------------------------------------------- /manifests/components/production/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1alpha1 2 | kind: Component 3 | 4 | configMapGenerator: 5 | - name: pipeline-variables 6 | behavior: merge 7 | envs: 8 | - pipeline.env 9 | 10 | namespace: gis-apps 11 | 12 | replacements: 13 | - path: replacement.yaml 14 | -------------------------------------------------------------------------------- /manifests/components/production/pipeline.env: -------------------------------------------------------------------------------- 1 | ENVIRONMENT=production 2 | ING_HOST=geoclient.nyc.gov -------------------------------------------------------------------------------- /manifests/components/production/replacement.yaml: -------------------------------------------------------------------------------- 1 | - source: 2 | kind: ConfigMap 3 | name: pipeline-variables 4 | fieldPath: data.ENVIRONMENT 5 | targets: 6 | - select: 7 | kind: Deployment 8 | fieldPaths: 9 | - metadata.labels.environment 10 | - select: 11 | kind: HorizontalPodAutoscaler 12 | fieldPaths: 13 | - metadata.labels.environment 14 | - select: 15 | kind: Service 16 | fieldPaths: 17 | - metadata.labels.environment -------------------------------------------------------------------------------- /manifests/components/pvc-azurefile/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1alpha1 2 | kind: Component 3 | 4 | resources: 5 | - pvc.yaml 6 | 7 | namespace: gis-apps 8 | 9 | replacements: 10 | - path: replacement.yaml -------------------------------------------------------------------------------- /manifests/components/pvc-azurefile/patch.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: PersistentVolumeClaim 3 | metadata: 4 | labels: 5 | environment: foo 6 | name: geoclient-v2 7 | namespace: gis-apps 8 | -------------------------------------------------------------------------------- /manifests/components/pvc-azurefile/pvc.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: PersistentVolumeClaim 3 | metadata: 4 | annotations: 5 | release-scope: component 6 | labels: 7 | app: geoclient-v2 8 | # Do not use col since claim may be used in blue and green releases. 9 | # col: COLOR 10 | environment: all 11 | name: PVC_NAME 12 | spec: 13 | accessModes: 14 | - ReadWriteMany 15 | resources: 16 | requests: 17 | storage: 100Gi 18 | storageClassName: azurefile-csi-premium 19 | volumeMode: Filesystem 20 | -------------------------------------------------------------------------------- /manifests/components/pvc-azurefile/replacement.yaml: -------------------------------------------------------------------------------- 1 | - source: 2 | kind: ConfigMap 3 | name: pipeline-variables 4 | fieldPath: data.PVC_NAME 5 | targets: 6 | - select: 7 | kind: PersistentVolumeClaim 8 | fieldPaths: 9 | - metadata.name 10 | 11 | - source: 12 | kind: ConfigMap 13 | name: pipeline-variables 14 | fieldPath: data.ENVIRONMENT 15 | targets: 16 | - select: 17 | kind: PersistentVolumeClaim 18 | fieldPaths: 19 | - metadata.labels.environment 20 | -------------------------------------------------------------------------------- /manifests/components/pvc-hostpath/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1alpha1 2 | kind: Component 3 | 4 | resources: 5 | - pvc.yaml 6 | 7 | namespace: gis-apps 8 | 9 | replacements: 10 | - path: replacement.yaml -------------------------------------------------------------------------------- /manifests/components/pvc-hostpath/patch.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: PersistentVolumeClaim 3 | metadata: 4 | labels: 5 | environment: foo 6 | name: geoclient-v2 7 | namespace: gis-apps 8 | -------------------------------------------------------------------------------- /manifests/components/pvc-hostpath/pvc.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: PersistentVolumeClaim 3 | metadata: 4 | annotations: 5 | release-scope: component 6 | labels: 7 | app: geoclient-v2 8 | # Do not use col since claim may be used in blue and green releases. 9 | # col: COLOR 10 | environment: all 11 | name: PVC_NAME 12 | spec: 13 | accessModes: 14 | - ReadWriteOnce 15 | resources: 16 | requests: 17 | storage: 4Gi 18 | storageClassName: csi-hostpath-sc -------------------------------------------------------------------------------- /manifests/components/pvc-hostpath/replacement.yaml: -------------------------------------------------------------------------------- 1 | - source: 2 | kind: ConfigMap 3 | name: pipeline-variables 4 | fieldPath: data.PVC_NAME 5 | targets: 6 | - select: 7 | kind: PersistentVolumeClaim 8 | fieldPaths: 9 | - metadata.name 10 | 11 | - source: 12 | kind: ConfigMap 13 | name: pipeline-variables 14 | fieldPath: data.ENVIRONMENT 15 | targets: 16 | - select: 17 | kind: PersistentVolumeClaim 18 | fieldPaths: 19 | - metadata.labels.environment 20 | -------------------------------------------------------------------------------- /manifests/overlays/app/dev/no-pvc/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | 4 | resources: 5 | - ../../../../base/resources 6 | 7 | components: 8 | - ../../../../components/development 9 | -------------------------------------------------------------------------------- /manifests/overlays/app/dev/pvc/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | 4 | resources: 5 | - ../../../../base/resources 6 | 7 | components: 8 | - ../../../../components/development 9 | - ../../../../components/pvc-azurefile 10 | -------------------------------------------------------------------------------- /manifests/overlays/app/minikube/base/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | 4 | resources: 5 | - ../../../../base/resources 6 | 7 | components: 8 | - ../../../../components/minikube 9 | -------------------------------------------------------------------------------- /manifests/overlays/app/minikube/base/replacement.yaml: -------------------------------------------------------------------------------- 1 | - source: 2 | kind: ConfigMap 3 | name: pipeline-variables 4 | fieldPath: data.COLOR 5 | targets: 6 | - select: 7 | kind: Ingress 8 | fieldPaths: 9 | - spec.rules.0.http.paths.0.backend.service.name 10 | - spec.rules.0.http.paths.1.backend.service.name 11 | options: 12 | delimiter: '-' 13 | index: 16 14 | 15 | - source: 16 | kind: ConfigMap 17 | name: pipeline-variables 18 | fieldPath: data.SVC_PORT 19 | targets: 20 | - select: 21 | kind: Ingress 22 | fieldPaths: 23 | - spec.rules.0.http.paths.0.backend.service.port.number 24 | - spec.rules.0.http.paths.1.backend.service.port.number 25 | 26 | - source: 27 | kind: ConfigMap 28 | name: pipeline-variables 29 | fieldPath: data.ING_HOST 30 | targets: 31 | - select: 32 | kind: Ingress 33 | fieldPaths: 34 | - spec.rules.0.host 35 | - spec.tls.0.hosts.0 36 | 37 | - source: 38 | kind: ConfigMap 39 | name: pipeline-variables 40 | fieldPath: data.ING_HOST 41 | targets: 42 | - select: 43 | kind: Ingress 44 | fieldPaths: 45 | - spec.tls.0.secretName 46 | options: 47 | delimiter: '-' 48 | 49 | - source: 50 | kind: ConfigMap 51 | name: pipeline-variables 52 | fieldPath: data.ENVIRONMENT 53 | targets: 54 | - select: 55 | kind: Ingress 56 | fieldPaths: 57 | - metadata.labels.environment 58 | -------------------------------------------------------------------------------- /manifests/overlays/app/minikube/no-pvc/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | 4 | resources: 5 | - ../base 6 | -------------------------------------------------------------------------------- /manifests/overlays/app/minikube/pvc/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | 4 | resources: 5 | - ../base 6 | 7 | components: 8 | - ../../../../components/pvc-hostpath 9 | -------------------------------------------------------------------------------- /manifests/overlays/app/prd/no-pvc/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | 4 | resources: 5 | - ../../../../base/resources 6 | 7 | components: 8 | - ../../../../components/production 9 | -------------------------------------------------------------------------------- /manifests/overlays/app/prd/pvc/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | 4 | resources: 5 | - ../../../../base/resources 6 | 7 | components: 8 | - ../../../../components/production 9 | - ../../../../components/pvc-azurefile 10 | -------------------------------------------------------------------------------- /manifests/overlays/ingress-nginx/base/ingress.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.k8s.io/v1 2 | kind: Ingress 3 | metadata: 4 | annotations: 5 | nginx.ingress.kubernetes.io/rewrite-target: /geoclient/v$1/$2 6 | nginx.ingress.kubernetes.io/ssl-redirect: "false" 7 | nginx.ingress.kubernetes.io/use-regex: "true" 8 | release-scope: ingress-only 9 | labels: 10 | app: geoclient-v2 11 | environment: ENVIRONMENT 12 | name: geoclient-v2 13 | spec: 14 | ingressClassName: nginx 15 | rules: 16 | - host: ING_HOST 17 | http: 18 | paths: 19 | - backend: 20 | service: 21 | name: geoclient-v2 22 | port: 23 | number: -1 # SVC_PORT 24 | path: /geoclient/v(2)/(.*) 25 | pathType: Prefix 26 | tls: 27 | - hosts: 28 | - ING_HOST 29 | secretName: ING_HOST-secret 30 | -------------------------------------------------------------------------------- /manifests/overlays/ingress-nginx/base/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | 4 | resources: 5 | - ../../../base/properties 6 | - ingress.yaml 7 | 8 | namespace: gis-apps 9 | -------------------------------------------------------------------------------- /manifests/overlays/ingress-nginx/dev/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | 4 | resources: 5 | - ../base 6 | 7 | components: 8 | - ../../../components/development 9 | 10 | replacements: 11 | - path: replacement.yaml 12 | -------------------------------------------------------------------------------- /manifests/overlays/ingress-nginx/dev/replacement.yaml: -------------------------------------------------------------------------------- 1 | - source: 2 | kind: ConfigMap 3 | name: pipeline-variables 4 | fieldPath: data.COLOR 5 | targets: 6 | - select: 7 | kind: Ingress 8 | fieldPaths: 9 | - spec.rules.0.http.paths.0.backend.service.name 10 | options: 11 | delimiter: '-' 12 | index: 16 13 | 14 | - source: 15 | kind: ConfigMap 16 | name: pipeline-variables 17 | fieldPath: data.SVC_PORT 18 | targets: 19 | - select: 20 | kind: Ingress 21 | fieldPaths: 22 | - spec.rules.0.http.paths.0.backend.service.port.number 23 | 24 | - source: 25 | kind: ConfigMap 26 | name: pipeline-variables 27 | fieldPath: data.ING_HOST 28 | targets: 29 | - select: 30 | kind: Ingress 31 | fieldPaths: 32 | - spec.rules.0.host 33 | - spec.tls.0.hosts.0 34 | 35 | - source: 36 | kind: ConfigMap 37 | name: pipeline-variables 38 | fieldPath: data.ING_HOST 39 | targets: 40 | - select: 41 | kind: Ingress 42 | fieldPaths: 43 | - spec.tls.0.secretName 44 | options: 45 | delimiter: '-' 46 | 47 | - source: 48 | kind: ConfigMap 49 | name: pipeline-variables 50 | fieldPath: data.ENVIRONMENT 51 | targets: 52 | - select: 53 | kind: Ingress 54 | fieldPaths: 55 | - metadata.labels.environment 56 | -------------------------------------------------------------------------------- /manifests/overlays/ingress-nginx/prd/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | 4 | resources: 5 | - ../base 6 | 7 | components: 8 | - ../../../components/production 9 | 10 | replacements: 11 | - path: replacement.yaml 12 | -------------------------------------------------------------------------------- /manifests/overlays/ingress-nginx/prd/replacement.yaml: -------------------------------------------------------------------------------- 1 | - source: 2 | kind: ConfigMap 3 | name: pipeline-variables 4 | fieldPath: data.COLOR 5 | targets: 6 | - select: 7 | kind: Ingress 8 | fieldPaths: 9 | - spec.rules.0.http.paths.0.backend.service.name 10 | options: 11 | delimiter: '-' 12 | index: 16 13 | 14 | - source: 15 | kind: ConfigMap 16 | name: pipeline-variables 17 | fieldPath: data.SVC_PORT 18 | targets: 19 | - select: 20 | kind: Ingress 21 | fieldPaths: 22 | - spec.rules.0.http.paths.0.backend.service.port.number 23 | 24 | - source: 25 | kind: ConfigMap 26 | name: pipeline-variables 27 | fieldPath: data.ING_HOST 28 | targets: 29 | - select: 30 | kind: Ingress 31 | fieldPaths: 32 | - spec.rules.0.host 33 | - spec.tls.0.hosts.0 34 | 35 | - source: 36 | kind: ConfigMap 37 | name: pipeline-variables 38 | fieldPath: data.ING_HOST 39 | targets: 40 | - select: 41 | kind: Ingress 42 | fieldPaths: 43 | - spec.tls.0.secretName 44 | options: 45 | delimiter: '-' 46 | 47 | - source: 48 | kind: ConfigMap 49 | name: pipeline-variables 50 | fieldPath: data.ENVIRONMENT 51 | targets: 52 | - select: 53 | kind: Ingress 54 | fieldPaths: 55 | - metadata.labels.environment 56 | -------------------------------------------------------------------------------- /manifests/overlays/pvc-azurefile/base/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | 4 | resources: 5 | - ../../../base/properties 6 | - pvc.yaml 7 | 8 | namespace: gis-apps 9 | 10 | #components: 11 | # - ../../components/development 12 | # - ../../components/production 13 | # 14 | #replacements: 15 | # - path: replacement.yaml -------------------------------------------------------------------------------- /manifests/overlays/pvc-azurefile/base/pvc.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: PersistentVolumeClaim 3 | metadata: 4 | annotations: 5 | release-scope: pvc-only 6 | labels: 7 | app: geoclient-v2 8 | # Do not use col since claim may be used in blue and green releases. 9 | # col: COLOR 10 | environment: all 11 | name: PVC_NAME 12 | spec: 13 | accessModes: 14 | - ReadWriteMany 15 | resources: 16 | requests: 17 | storage: 100Gi 18 | storageClassName: azurefile-csi-premium 19 | volumeMode: Filesystem 20 | -------------------------------------------------------------------------------- /manifests/overlays/pvc-azurefile/dev/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | 4 | resources: 5 | - ../base 6 | 7 | components: 8 | - ../../../components/development 9 | 10 | replacements: 11 | - path: replacement.yaml 12 | -------------------------------------------------------------------------------- /manifests/overlays/pvc-azurefile/dev/replacement.yaml: -------------------------------------------------------------------------------- 1 | - source: 2 | kind: ConfigMap 3 | name: pipeline-variables 4 | fieldPath: data.PVC_NAME 5 | targets: 6 | - select: 7 | kind: PersistentVolumeClaim 8 | fieldPaths: 9 | - metadata.name 10 | 11 | - source: 12 | kind: ConfigMap 13 | name: pipeline-variables 14 | fieldPath: data.ENVIRONMENT 15 | targets: 16 | - select: 17 | kind: PersistentVolumeClaim 18 | fieldPaths: 19 | - metadata.labels.environment 20 | -------------------------------------------------------------------------------- /manifests/overlays/pvc-azurefile/prd/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | 4 | resources: 5 | - ../base 6 | 7 | components: 8 | - ../../../components/production 9 | 10 | replacements: 11 | - path: replacement.yaml 12 | -------------------------------------------------------------------------------- /manifests/overlays/pvc-azurefile/prd/replacement.yaml: -------------------------------------------------------------------------------- 1 | - source: 2 | kind: ConfigMap 3 | name: pipeline-variables 4 | fieldPath: data.PVC_NAME 5 | targets: 6 | - select: 7 | kind: PersistentVolumeClaim 8 | fieldPaths: 9 | - metadata.name 10 | 11 | - source: 12 | kind: ConfigMap 13 | name: pipeline-variables 14 | fieldPath: data.ENVIRONMENT 15 | targets: 16 | - select: 17 | kind: PersistentVolumeClaim 18 | fieldPaths: 19 | - metadata.labels.environment 20 | -------------------------------------------------------------------------------- /manifests/overlays/pvc-hostpath/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | 4 | resources: 5 | - ../../base/properties 6 | - pvc.yaml 7 | 8 | namespace: gis-apps 9 | 10 | components: 11 | - ../../components/minikube 12 | 13 | replacements: 14 | - path: replacement.yaml 15 | -------------------------------------------------------------------------------- /manifests/overlays/pvc-hostpath/pvc.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: PersistentVolumeClaim 3 | metadata: 4 | annotations: 5 | release-scope: pvc-only 6 | labels: 7 | app: geoclient-v2 8 | # Do not use col since claim may be used in blue and green releases. 9 | # col: COLOR 10 | environment: all 11 | name: PVC_NAME 12 | spec: 13 | accessModes: 14 | - ReadWriteOnce 15 | resources: 16 | requests: 17 | storage: 4Gi 18 | storageClassName: csi-hostpath-sc -------------------------------------------------------------------------------- /manifests/overlays/pvc-hostpath/replacement.yaml: -------------------------------------------------------------------------------- 1 | - source: 2 | kind: ConfigMap 3 | name: pipeline-variables 4 | fieldPath: data.PVC_NAME 5 | targets: 6 | - select: 7 | kind: PersistentVolumeClaim 8 | fieldPaths: 9 | - metadata.name 10 | 11 | - source: 12 | kind: ConfigMap 13 | name: pipeline-variables 14 | fieldPath: data.ENVIRONMENT 15 | targets: 16 | - select: 17 | kind: PersistentVolumeClaim 18 | fieldPaths: 19 | - metadata.labels.environment 20 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | // 4 | // Possible workaround for the issue descirbed in the note below: 5 | // 6 | // maven { 7 | // url './local-plugins' 8 | // } 9 | // 10 | gradlePluginPortal() 11 | } 12 | // 13 | // NOTE: 14 | // If the nested geosupport-plugin project is configured to use either 15 | // maven-publish or publish-publish plugins, this includeBuild statement 16 | // may not work. 17 | // See ./geosupport-plugin/build.gradle 18 | // See https://docs.gradle.org/current/userguide/composite_builds.html#included_build_substitution_limitations 19 | // 20 | // includeBuild './geosupport-plugin' 21 | } 22 | 23 | rootProject.name = 'geoclient' 24 | 25 | include 'documentation' 26 | include 'geoclient-jni' 27 | include 'geoclient-core' 28 | include 'geoclient-parser' 29 | include 'geoclient-service' 30 | include 'geoclient-test' 31 | include 'geoclient-utils:cli' 32 | include 'geoclient-utils:jni-test' 33 | 34 | // Only works when the '--scan' parameter is passed 35 | //gradleEnterprise { 36 | // buildScan { 37 | // termsOfServiceUrl = 'https://gradle.com/terms-of-service' 38 | // termsOfServiceAgree = 'yes' 39 | // obfuscation { 40 | // username { "github" } 41 | // hostname { "localhost" } 42 | // ipAddresses { addresses -> addresses.collect { address -> "0.0.0.0"} } 43 | // } 44 | // } 45 | //} 46 | -------------------------------------------------------------------------------- /src/dist/notice.txt: -------------------------------------------------------------------------------- 1 | Geoclient ${version} 2 | Copyright (c) 2013-${copyright} Matthew Lipper 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | -------------------------------------------------------------------------------- /src/doc/examples/simple-js/build.gradle: -------------------------------------------------------------------------------- 1 | group = 'gov.nyc.doitt.gis' 2 | version = '2.0.0' 3 | 4 | apply plugin: 'base' 5 | 6 | import org.apache.tools.ant.filters.FixCrLfFilter 7 | import org.apache.tools.ant.filters.ReplaceTokens 8 | 9 | task filter(type: Copy) { 10 | from 'src/main/webapp' 11 | into "$buildDir/$distname" 12 | filter(FixCrLfFilter) 13 | filter(ReplaceTokens, tokens: [appId: appId, appKey: appKey, endpoint: endpoint, protocol: protocol, host: host, port: port]) 14 | filteringCharset = 'UTF-8' 15 | } 16 | 17 | task dist(type: Zip) { 18 | archiveBaseName = distname 19 | from filter 20 | into distname 21 | } 22 | 23 | build.dependsOn clean, dist 24 | 25 | -------------------------------------------------------------------------------- /src/doc/examples/simple-js/gradle.properties: -------------------------------------------------------------------------------- 1 | appId= 2 | appKey= 3 | distname=geoclient-simple-js-example 4 | endpoint=geoclient/v2/address.json 5 | host=localhost 6 | port=8080 7 | protocol=http 8 | #subscriptionKey= 9 | #endpoint=geo/geoclient/v1/address.json 10 | #host=api.nyc.gov 11 | #port=443 12 | #protocol=https 13 | -------------------------------------------------------------------------------- /src/doc/examples/simple-js/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CityOfNewYork/geoclient/2aa792c401445f232eb7266efaa43b2cdfc443c3/src/doc/examples/simple-js/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /src/doc/examples/simple-js/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /src/doc/examples/simple-js/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'geoclient-simple-js-example' 2 | -------------------------------------------------------------------------------- /src/doc/geoclient-native.md: -------------------------------------------------------------------------------- 1 | # Native Environment Configuration 2 | 3 | ## Diagnostic Tools 4 | 5 | *Show build files which use native compilation variables:* 6 | 7 | ```bash 8 | find . -name '*.gradle' -type f -exec egrep -li --color '(g[cs][a-z]+Path|geofiles)' {} \; 9 | ``` 10 | 11 | *Show line content of Gradle files using native compilation variables:* 12 | 13 | ```bash 14 | find . -name '*.gradle' -type f -exec egrep -Hin --color '(g[cs][a-z]+Path|geofiles)' {} \; 15 | ``` 16 | 17 | ## Geoclient Variables 18 | 19 | | Gradle Property | Environment Variable | Linux | Windows | 20 | |-----------------|----------------------|---------------------------------|-------------------------------| 21 | | `gsIncludePath` | `GS_INCLUDE_PATH` | `geo.h`, `pac.h`, `wa_fields.h` | `NYCgeo.h`, `geo.h`, `pac.h` | 22 | | `gsLibraryPath` | `GS_LIBRARY_PATH` | `lib*.so` | `*.dll` | 23 | | `gcIncludePath` | `GC_INCLUDE_PATH` | `geoclient.h` | `geoclient.h` | 24 | | `gcLibraryPath` | `GC_LIBRARY_PATH` | `libgeoclientjni-linux_x64.so` | `geoclientjni-windows_x64.dll`| 25 | 26 | ## Platform/Runtime Variables 27 | 28 | | Java System Property | Linux Default Value | Windows Default Value | Geoclient Logic | 29 | |-----------------------|---------------------|-----------------------|-----------------| 30 | | `-Djava.library.path` | `LD_LIBRARY_PATH` | `PATH` | n/a | 31 | | `-Djava.home` | `JAVA_HOME` | `JAVA_HOME` | `JNI_JAVA_HOME` | 32 | -------------------------------------------------------------------------------- /src/doc/geoclient-runtime.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CityOfNewYork/geoclient/2aa792c401445f232eb7266efaa43b2cdfc443c3/src/doc/geoclient-runtime.png -------------------------------------------------------------------------------- /src/doc/presentations/BetaNYC-nyc-doitt-geoclient.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CityOfNewYork/geoclient/2aa792c401445f232eb7266efaa43b2cdfc443c3/src/doc/presentations/BetaNYC-nyc-doitt-geoclient.pdf -------------------------------------------------------------------------------- /src/doc/presentations/Code4LibNYC-geoclient-overview.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CityOfNewYork/geoclient/2aa792c401445f232eb7266efaa43b2cdfc443c3/src/doc/presentations/Code4LibNYC-geoclient-overview.pdf -------------------------------------------------------------------------------- /src/doc/presentations/geoclient-why-bother.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CityOfNewYork/geoclient/2aa792c401445f232eb7266efaa43b2cdfc443c3/src/doc/presentations/geoclient-why-bother.pdf -------------------------------------------------------------------------------- /src/doc/presentations/nyc-geoclient-api.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CityOfNewYork/geoclient/2aa792c401445f232eb7266efaa43b2cdfc443c3/src/doc/presentations/nyc-geoclient-api.pdf -------------------------------------------------------------------------------- /src/scripts/packages.txt: -------------------------------------------------------------------------------- 1 | srcdir=./geoclient-core/src/test/java 2 | gov/nyc/doitt/gis/geoclient/api 3 | gov/nyc/doitt/gis/geoclient/config 4 | gov/nyc/doitt/gis/geoclient/config/xml 5 | gov/nyc/doitt/gis/geoclient/function 6 | gov/nyc/doitt/gis/geoclient/test 7 | gov/nyc/doitt/gis/geoclient/util 8 | srcdir=./geoclient-jni/src/test/java 9 | gov/nyc/doitt/gis/geoclient/jni/util 10 | srcdir=./geoclient-parser/src/test/java 11 | gov/nyc/doitt/gis/geoclient/parser 12 | gov/nyc/doitt/gis/geoclient/parser/configuration 13 | gov/nyc/doitt/gis/geoclient/parser/regex 14 | gov/nyc/doitt/gis/geoclient/parser/test 15 | gov/nyc/doitt/gis/geoclient/parser/token 16 | gov/nyc/doitt/gis/geoclient/parser/util 17 | srcdir=./geoclient-service/src/test/java 18 | gov/nyc/doitt/gis/geoclient/service/configuration 19 | gov/nyc/doitt/gis/geoclient/service/domain 20 | gov/nyc/doitt/gis/geoclient/service/invoker 21 | gov/nyc/doitt/gis/geoclient/service/mapper 22 | gov/nyc/doitt/gis/geoclient/service/search 23 | gov/nyc/doitt/gis/geoclient/service/search/policy 24 | gov/nyc/doitt/gis/geoclient/service/search/request 25 | gov/nyc/doitt/gis/geoclient/service/search/task 26 | gov/nyc/doitt/gis/geoclient/service/search/web 27 | gov/nyc/doitt/gis/geoclient/service/search/web/response 28 | gov/nyc/doitt/gis/geoclient/service/web 29 | gov/nyc/doitt/gis/geoclient/service/xstream 30 | srcdir=./geoclient-test/src/test/java 31 | gov/nyc/doitt/gis/geoclient/test 32 | --------------------------------------------------------------------------------