Skip to content

Readmes and license#20

Open
dvalenca wants to merge 126 commits intomainfrom
readmes_and_license
Open

Readmes and license#20
dvalenca wants to merge 126 commits intomainfrom
readmes_and_license

Conversation

@dvalenca
Copy link
Copy Markdown

No description provided.

…-profile

- Add /v1/cyclist-profiles/analysis endpoint with comprehensive filtering
- Support filters: location (lat/lon/radius), year, gender, race, income, education, age_category
- Returns filtered demographics breakdown with counts and percentages
- Flexible endpoint allows any combination of filters
- Add OpenAPI route definition and handler
- Update test-connections.js and generate-openapi.ts
- All 12 endpoints now included in OpenAPI specification

Examples:
- ?gender=Feminino&year=2024 (213 responses, 100% female)
- ?lat=-8.05&lon=-34.88&radius=2000&gender=Feminino&race=Parda (205 responses)
- ?education=Superior (0 responses - no exact match)
…nd move existing to v2

- Move existing endpoints from v1 to v2 (/v2/summary, /v2/deaths/*, /v2/stats)
- Add new v1 API structure for RMR data:
  - /v1/summary - resumo por local ocorrência/residência
  - /v1/cities-by-year - mortes por cidade divididas por ano
  - /v1/filtros - endpoint principal com filtros avançados
  - /v1/matrix - análise de matriz de dados
  - /v1/causas-secundarias - causas secundárias
- Support bilingual parameters (PT/EN) in v1/filtros
- Update test-connections.js with new endpoints
- Add .env file with database configuration
- Remove SSL config for local development
- Simplify street search queries to use normalized nlogra_conc column
- All 5 endpoints now working (75/76 total endpoints)
- Add /v1/infrastructure/geojson endpoint
- Returns FeatureCollection format compatible with mapping libraries
- Supports type and limit query parameters
- Update OpenAPI documentation
- Fix TypeScript compilation issues
- Add detailed descriptions and examples to InfrastructureSchema fields
- Improve query parameter documentation with type examples
- Update generate-openapi.ts to auto-copy specs to docs directory
- Reorganize route paths to avoid conflicts (/v1/infrastructure-geojson, /v1/infrastructure-nearby)
- Add comprehensive OpenAPI metadata for all 4 infrastructure endpoints:
  - GET /v1/infrastructure - List with filters
  - GET /v1/infrastructure/{id} - Get by ID
  - GET /v1/infrastructure-geojson - GeoJSON format
  - GET /v1/infrastructure-nearby - Proximity search
…nd improved nomenclature

- Add gzip compression middleware for 90%+ size reduction
- Implement geometry simplification with ST_Simplify (optional)
- Add decimal precision control for coordinates (4-6 decimal places)
- Add minimal mode with only essential status properties
- Improve nomenclature for PDC status categories:
  - pdc_realizado_designado: Built within PDC with designated infrastructure
  - pdc_realizado_nao_designado: Built within PDC with non-designated infrastructure
  - realizado_fora_pdc: Built outside PDC
  - pdc_nao_realizado: PDC not built
- Add pagination support (limit/offset) without forced defaults
- Update OpenAPI documentation with new parameters
- Optimize response size from 5.6MB to 283KB with all optimizations combined
- Add only_all query parameter to return direct FeatureCollection
- Update handler to return simplified format when only_all=true
- Update route schema to support both response formats
- Maintains backward compatibility with existing all/byCity structure
- Add by_length parameter to prioritize streets by extension
- Add by_elements parameter (structure ready for future implementation)
- Implement hybrid fuzzy search with pg_trgm fallback to ILIKE
- Add length field in search response when requested
- Support both similarity-based and length-based ordering
- Maintain backward compatibility with existing search API

Examples:
- /v1/streets/search?q=boa&by_length=true (orders by street length)
- /v1/streets/search?q=boa (orders by similarity score)
…port

- Fix empty coordinates by using ST_AsGeoJSON for PostGIS geometry
- Change street details to return all segments with same name
- Convert response to proper GeoJSON FeatureCollection format
- Add totalSegments and totalLength in properties
- Support MultiLineString geometry from PostGIS
- Maintain backward compatibility with single ID lookup

Tested with AV BOA VIAGEM:
- Returns complete geometry with 16 line segments
- Total length: 8.498 km correctly calculated
- Proper GeoJSON FeatureCollection structure
- Resolves 'too many clients already' error
- Allows multiple services to connect simultaneously
- Adds shared_buffers configuration for better performance
- Atualiza schemas com estruturas de dados baseadas nos schemas reais do banco
- Adiciona schemas para cycling counts, traffic violations, cycling infra, shared bikes e bike racks
- Copia OpenAPI atualizado para documentação (porta 3001)
- Cria estrutura para rotas de tráfego (preparação para implementação futura)
…atic research locations

- Add static list of 17 research locations with correct coordinates
- Implement efficient in-memory search for cycling profile availability
- Return 1/0 for cycling_profile field in data summary endpoint
- Support bidirectional street matching (works for both streets in intersections)
- Maintain real database queries for cycling_counts data
- Workaround for incorrect coordinates in cyclist_profiles table
… sources

- Remove simulated dangerous_streets and traffic_violations fields
- Implement real cycling infrastructure PDC analysis queries
- Add emergency_calls count from emergency_calls table
- Maintain cycling_counts with 30m precision radius
- Keep cycling_profile static lookup for accurate results
- All endpoints now return only real data from database
- Tested with Agamenon (no profile/counts) and Domingos Ferreira (has both)
- Remove slow PDC spatial queries from data-summary (6s -> 0.059s)
- Keep only fast essential data: cycling_counts, cycling_profile, emergency_calls
- PDC analysis can be implemented as separate endpoint when needed
- Maintain data accuracy while dramatically improving response time
- All queries now use efficient indexes and simple lookups
Updated the license text to reflect the GNU Affero General Public License version 3, including copyright and terms.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant