For space-based warfare, would an orbiting satellite which was equipped with a railgun cannon be effective against a ground-based fort, or even an aeroplane, or another type of air transport? This is, of course with full data on the planet's surface, and the planet is reasonably earth-like.
The US and Russian governments appear to believe so, and are examining the possibility.
You don't need a powerful railgun; you just need something in orbit which can fire a telephone-pole with enough force to deorbit it, and with enough accuracy to hit a target.
The missile needs to essentially be a telephone pole of metal, since it will be reentering at orbital velocities, and will be ablating. You want it to impart most of its kinetic energy into the target, rather than just burn up through the atmosphere.
Really the only major cost is getting that mass of metal up into orbit; and the only real risk is destruction or takeover of the orbiting launch platform.
Edit: With a half-dozen or more satellites, impact time can be 12-15 minutes to pretty much anywhere on earth, and there would be little warning of a launch, since distinguishing a launch from orbital maneuvers made by the launcher would be difficult. While half the time taken by an ICBM, quarter of an hour isn't, obviously, good enough for impacting a moving target, but that's not what this is for: these are "bunker-busters", aimed at destroying nuclear missile launch sites.
A pre-emptive attack that destroyed all missile launch sides within 15 minutes would be a game-changer on the world stage, and this kind of thing is exactly why both the US and Russia have invested heavily in nuclear submarines: they are immune to such attacks, being mobile, hard to track, and protected by a large amount of water above them.
A world where kinetic bombardment was a known threat would also have similar mitigation tactics, along with just building their bunkers super deep underground.
This weapon could be used against mobile artillery emplacements, however, as these usually take more than a few minutes to set up; artillery would have to adapt to become mobile.
Temporary military encampments would also be really hard to create in a way that would protect against this form of attack. The resulting defense would be very small encampments, spread widely, or camping within civilian areas.
Yes, but ...
You are putting the railgun and projectile into orbit, at a considerable energy expenditure. Then you expend more energy to de-orbit the projectile, in a way that it impacts on the surface with several miles per second velocity and the resulting kinetic energy.
- Unless you have a real lot of railguns in different orbits, you will be limited how soon and how often any one target can be engaged. Google the "ground track" of recon and Earth science sats. Same principle here.
- The projectiles will probably need terminal guidance which can survive reentry, and even so it will be easier to hit a parked aircraft than a flying one.
- Firing the projectile will affect the orbit of the railgun. It will need engines and fuel to compensate.
On the other hand, you get to preposition your weapon in orbit and you can overfly other countries without violating their territorial airspace. So for a few, high-value targets, it might be a good idea. As general-purpose field artillery or ADA, probably not. Unless you are arriving by starship and your ammo is in orbit to start with.
"It depends", of course.
Against a static target you don't need a railgun, but merely gently de-orbit a dense projectile and let gravity do all the hard work for you (see Dewi Morgan's answer). Terminal velocity for such a weapon is about Mach 10 at sea level... a fairly respectable 3.45km/s. You might get a circular error probable as low as 10-20ft (or 3-6m in new money) which is certainly enough to take out even quite a small target, given the amount of boom the object will provide (about a tonne or so TNT equivalent).
You might think that a railgun will let you swat a target promptly without all that tedious hanging around and hit it a lot harder, but there are multiple problems here. Firstly, orbital speeds are fast (~7.8km/s for low Earth orbit) and if your railgun cannot reach those speeds then you're still just de-orbiting a projectile as if it were a rod-from-god, just slightly more briskly. And railgun limitations being what they are, your projectile will be smaller, lighter and less able to carry heat shielding and terminal guidance so your CEP will go up and your ability to hit small targets will go down.
You also have to remember though that your targets are sitting underneath ten tonnes of atmosphere. Trying to batter that out of the way of a hypervelocity projectile generates heat. A lot of heat. The rods from god are made of tungsten because it combines considerable density with a decent amount of heat resistance, but even they will be partially ablated before they hit their target. You fire a faster projectile, you'll only burn it up more quickly. Given the extreme speeds and descent angles you'd want, you can't realistically use any more ablative shielding and active cooling to help you. Save your railguns for other targets and other platforms. This isn't the place for them.
As for hitting an aircraft... dubious, depending on the aiming capabilities of your re-entry vehicle. Aircraft are small, and don't always move in an entirely predictable way, and the projectile will be going very fast so its reactions will have to be similarly quick... assuming you can fit the requisite smarts and sensors into your projectile, and have them survive launch and re-entry. You might shoot down a commercial flight this way, but probably not a hostile military flight that isn't make a pre-arranged and predictable course. Even the commercial flight won't have to manoeuver much, and there will be some lead time between you firing and the projectile entering some kind of terminal kill zone, and during that time it will be a very bright and clearly visible object. Anyone looking for such things can radio an alert. (note though that plasma is surprisingly good at absorbing radio waves and can function as a means of stealth, despite being a multi-thousand-degree brightly glowing fireball).
Finally, once you've shot your bolt, the nature of your satellite will be very obvious to pretty much everyone, and at that point is immediately vulnerable to ground launched antisatellite missiles and laser fire, or even to weapons on other killsats. You could try and shift your trajectory, but the odds of you actually escaping the notice of an angry and determined military power capable of tracking and hitting targets in space is slim. A railgun suited to hitting ground targets will very much not be suited to point defence, and after that the best you can hope for is that the debris that used to be your artillery sat hits something belonging to the other side. Bit of a gamble, that.
Even a very fast projectile has a lag time, currently railguns fire at about 7500km/hr speeds, which if my math is right is about 2km/s, which while very fast, if you're 100km up in low orbit, it's going to take somewhere between 30 seconds to a few minutes to hit something depending on where you're aiming. Static targets, highly effective. Moving targets, you need some type of mid-flight course correction, a smart-weapon. Orbital railguns to smash static defenses, infrastructure, and if leading a predictable and unsuspecting target like a supply train whose speed and direction could be calculated. Against fast-moving air targets or less-predictable ground targets, ineffective. Think of it more like artillery than a SAM. They're just too far away in orbit to be used that way.
Unless you have guided projectiles, you're going to have difficulty hitting anything small, or anything moving.
Long-range anti-aircraft guns are not a thing unless you fire massive barrages (and they gave up on that a long time ago).
A hypervelocity projectile might be useful against a static target like a fort, depending on how well prepared they are for that type of attack. (ie how deeply they are dug in), and it becomes a question of how much ammo you have against how much steel and concrete they have -- or what sort of active countermeasures.