Portugal (PT)
Quick facts
Section titled “Quick facts”| Field | Value |
|---|---|
| Drive side | Right-hand |
| Language(s) | Portuguese |
| Regulator | ANSR (Código da Estrada) |
| Code format | A-1 / B-1 / C-1 |
| Standard | Código da Estrada — Vienna Convention |
The @road-signs/pt package contains Portugal road signs from the Código da Estrada, Portugal’s road traffic code which follows the Vienna Convention.
Signs are sourced from Wikipedia / Wikimedia Commons. Signs are in the public domain.
Installation
Section titled “Installation”npm install @road-signs/ptSign categories
Section titled “Sign categories”| Category | Series | Description |
|---|---|---|
warning |
A series | Sinais de perigo — hazard warnings |
priority |
B series | Sinais de cedência de passagem — right-of-way |
prohibitory |
C series | Sinais de proibição — prohibitions |
mandatory |
D series | Sinais de obrigação — compulsory actions |
information |
E–L series | Sinais de informação — information signs |
import { signs, getSign, getSignByCode, getSignsByCategory } from '@road-signs/pt';
// Example below uses the real PT sign "dangerous-curve-to-right" — adjust to taste.
// All signssigns.length;
// By slug IDconst sign = getSign("dangerous-curve-to-right-dangerous-curve-to-right");
// By sign codeconst s = getSignByCode("dangerous-curve-to-right");
// All warning signsconst filtered = getSignsByCategory("warning");import { getSignsByCategory } from '@road-signs/pt';import { RoadSign } from '@road-signs/react';
const warningSigns = getSignsByCategory("warning");
export default function PTGrid() { return ( <div style={{ display: 'flex', gap: 8, flexWrap: 'wrap' }}> {warningSigns.map((sign) => ( <RoadSign key={sign.id} sign={sign} size={64} /> ))} </div> );}<script setup>import { getSignsByCategory } from '@road-signs/pt';import { RoadSign } from '@road-signs/vue';
const warningSigns = getSignsByCategory("warning");</script>
<template> <div style="display:flex;gap:8px;flex-wrap:wrap"> <RoadSign v-for="sign in warningSigns" :key="sign.id" :sign="sign" :size="64" /> </div></template>Coverage
Section titled “Coverage”| Metric | Value |
|---|---|
| Signs scraped | 228 |
| Signs with SVG | 228 |
| Missing SVG | 0 |
| Overall | 100% |
| Category | Scraped | With SVG | Missing | % |
|---|---|---|---|---|
warning |
47 | 47 | 0 | 100% |
priority |
12 | 12 | 0 | 100% |
prohibitory |
51 | 51 | 0 | 100% |
mandatory |
39 | 39 | 0 | 100% |
information |
79 | 79 | 0 | 100% |
Standard: Código da Estrada — Vienna Convention
SVG sources:
Coverage data is also published in the @road-signs/docs package.
TypeScript types
Section titled “TypeScript types”import type { PTSign, PTCategory } from '@road-signs/pt';
type PTCategory = 'information' | 'mandatory' | 'priority' | 'prohibitory' | 'warning';
interface PTSign { id: string; // e.g. "a1-danger-bend-right" code: string; // e.g. "A1" name: string; description: string; category: PTCategory; svg: string; // inline SVG string assets: { svg: string; png: Record<number, string>; jpg: Record<number, string>; webp: Record<number, string>; };}